Splunk Search

Calculate the Difference from the previous week results.

jcarstar
Engager

I have a simple timechart showing a percentage of status that = success from the total count of phase=second found.

index=logs phase=second
| timechart span=7d count AS total count(eval(status="SUCCESS")) AS success
| eval Percentage=round((success/total)*100,2)
| table _time Percentage

This report runs every 7days so it tells me the percentage for that week.

_time   Percentage   
2018-05-17  31.91
2018-05-24  61.38
2018-05-31  11.36

Trying to calculate the Deltas from week-to-week. so an example would be like below

_time   Percentage   
2018-05-17-2018-05-24   0.3191 - 0.6138 = -0.2947 change
2018-05-24-2018-05-31 0.6138 - 0.1136 = 0.5002 change

I cannot seem to figure out how to subtract the values every 7 days from the previous value from 7 days.

Thanks!

Tags (1)
0 Karma

manjunathmeti
Champion

Use delta command,

index=logs phase=second
| timechart span=7d count AS total count(eval(status="SUCCESS")) AS success
| eval Percentage=round((success/total), 2)
| table _time Percentage
| delta Percentage as Percentage
| eval Percentage = -Percentage

jcarstar
Engager

this worked, thanks

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...