Splunk Search

search for eventcount comparison for two different time ranges

john_q
Explorer

i want to count eventcount comparison using time trends chart for today , lastweek and last2weeks. below are the my searches

index=something sourcetype=something earliest=-0d@d latest=@h| timechart count as "Today" | appendcols
[search index=something sourcetype=something earliest=-7d@w0 latest=@w0
| timechart count as "Previous week"]

for this iam getting output like this:alt text

Tags (1)
0 Karma

niketn
Legend

@john_q could you please add a mock screenshot of what is the expected output?

Ideally when you compare time-series data over a duration, the duration needs to remain the same for different time period selected (as duration is plotted on fixed x-axis). For example You can compare current week with Previous week and that with the week before. For such scenario, you can use the timewrap command which is available version 6.5 onward.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

MuS
Legend

Hi john_q,

take a look at this answer https://answers.splunk.com/answers/663294/timewrap-compare-last-24-hours-to-the-same-day-ove.html to learn how this can be done without any sub search.

cheers, MuS

0 Karma

john_q
Explorer

i getting results like mentioned below.

      _time                              Today              LastWeek

06-07-2018 06:01:01 120 1000
06-07-2018 07:11:01 10 1012
06-07-2018 08:01:01 20 1128
06-07-2018 09:05:01 105 1222
06-07-2018 09:41:01 80

06-07-2018 10:15:01 16

06-07-2018 10:22:01 12

06-07-2018 10:51:01 1

two line are showing today time only and LastWeek legend showing today time only instead of lastweek time which is not fully completed. plz find the above attached image.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...