Splunk Search

How to create a chart of the error rate over time?

tmtcollins
Explorer

Hi, I would like to create a chart of the error rate over time.  I have data that shows status= DOWNLOAD_COMPLETE  and status = FAILD

I can calculate this for a point in time with the below. But can anyone help get the error rate over time?

 

 logType=error OR logType=service context=retrieve status=DOWNLOAD_COMPLETE OR status=FAILED 
|  stats count(correlationId) as total_count by status  | transpose header_field=status 
| eval errorRate=FAILED/(FAILED+DOWNLOAD_COMPLETE)*100
| table DOWNLOAD_COMPLETE, FAILED, errorRate

 

Labels (4)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

This should do it.

 logType=error OR logType=service context=retrieve status=DOWNLOAD_COMPLETE OR status=FAILED 
| timechart count(correlationId) as total_count by status
| eval errorRate=FAILED/(FAILED+DOWNLOAD_COMPLETE)*100
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This should do it.

 logType=error OR logType=service context=retrieve status=DOWNLOAD_COMPLETE OR status=FAILED 
| timechart count(correlationId) as total_count by status
| eval errorRate=FAILED/(FAILED+DOWNLOAD_COMPLETE)*100
---
If this reply helps you, Karma would be appreciated.
0 Karma

tmtcollins
Explorer

Worked perfectly! thanks

 

Tags (1)
0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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