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!

New Year, New Changes for Splunk Certifications

As we embrace a new year, we’re making a small but important update to the Splunk Certification ...

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

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

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