Splunk Search

How to generate a chart that will display counts of distinct values by build?

shawny2005
Path Finder

We are trying to do some charting that requires counts of distinct values per build.

input would be

build|result
121   fail
121   pass
121   fail
77    pass
77    fail

in my chart I basically want

build 121 2 fails/1 pass and build 77 1 fail/1 pass

I thought it was a streamstats command followed by an accum command but I can't get it to work. I can get it to count the values per build, but not once I need to separate all the results out.

0 Karma
1 Solution

sundareshr
Legend

Try this

... | chart count over build by result

View solution in original post

0 Karma

sundareshr
Legend

Try this

... | chart count over build by result
0 Karma

shawny2005
Path Finder

this is perfect.

0 Karma

maciep
Champion

maybe something like

... | stats count(eval(result="fail")) as fail_count count(eval(result="pass")) as pass_count by build

shawny2005
Path Finder

stats count(result) by build gives the total number of tests run, but I want how many passed and failed for each build.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...