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!

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

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...