Splunk Search

How can I quantify the intermittent failure of a regular event?

dreeck
Path Finder

My logs contain records of scheduled events. Sometimes the events fail, usually in 1 of 2 modes: systematic - once they fail they always fail (until corrected) or intermittent (they fail, the succeed, succeed, succeed, then fail fail fail then succeed). I'd like to produce a report that shows
- per time period (say a day)
- for all events belonging to a schedule
- how intermittently are the scheduled events failing
- what percentage of events are failures

For example
For 1/1/2016
Schedule #1728 70% success 0% itermittency (for a schedule in which 30% of events were failures, and once the failures start they never stop)
Schedule #1821 70% success 100% intermittency (for a schedule in which 30% were failures, and after every failure the next event was a success)

0 Karma
1 Solution

sundareshr
Legend

See if this gets your going

base search | eval score=if(status="success", 1, 0) | streamstats window=1 current=f values(score) as nscore by schedule | streamstats count(eval(score=nscore)) as c by schedule | stats count count(eval(status="success")) as success count(eval(status="fail")) as fail max(c) as inter by schedule | eval s_perc=success/count*100 | eval f_perc=fail/count*100 | eval i_perc=inter/fail

Basically, the higher the value for inter, the higher the intermitancy

View solution in original post

0 Karma

sundareshr
Legend

See if this gets your going

base search | eval score=if(status="success", 1, 0) | streamstats window=1 current=f values(score) as nscore by schedule | streamstats count(eval(score=nscore)) as c by schedule | stats count count(eval(status="success")) as success count(eval(status="fail")) as fail max(c) as inter by schedule | eval s_perc=success/count*100 | eval f_perc=fail/count*100 | eval i_perc=inter/fail

Basically, the higher the value for inter, the higher the intermitancy

0 Karma

dreeck
Path Finder

This is generating results for me, but I had to mess around a bit to get my JSON fields evaluated. Tip: for a JSON field, enclose the field name in single quotes, and the value in double quotes. eval score = if('json.field1'="banana", 1, 0) works. eval score = if(json.field1=banana, 1, 0) don't.

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...