Splunk Search

extract field value

iamniks
Explorer

Hi, we have csv file in below format.

PROJECT_NAME USER_NAME STATUS

WEB_xxxx David PASSED
WEB_xxxx Rapkin FAILED
WEB_xxxx Rapkin PASSED
WEB_xxxx Diana PASSED
DC_xxxx John FAILED
PROMOTE_xxxx Paul PASSED
AST_xxxx John PASSED

Would like to generate report as below. Basically we would like to group projects based on their prefix and have a count for each group.

PROJECT: COUNT PASSED FAILED
WEB 4 3 1
DC 1 0 1
PROMOTE 1 1 0
AST 1 1 0

Tags (3)
0 Karma

woodcock
Esteemed Legend

Try this:

... | rex "^(?<PROJECT>[^_]*)_[\S]*\s+(?<USER>[\S]*)\s+(?<STATUS>[\S]*) | stats count AS COUNT count(eval(STATUS="PASSED)) AS PASSED BY PROJECT | eval FAILED = COUNT - PASSED
0 Karma

Ayn
Legend

How is this different from this question? http://splunk-base.splunk.com/answers/34471/field-value-count

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...