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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...