Splunk Search

How to create a report to show an event occurring in the last minute, last 10 minutes, and since midnight?

akhasriya
Engager

I am looking to produce a report to show an event occurring in the last minute, last 10 minutes and since midnight:
eg:
event in the last minute 10
event in the last 10 minutes 32
event daily 1105

0 Karma
1 Solution

somesoni2
Revered Legend

Try like this (update the first line of search per your's, keep the same earliest and latest)

index=foo sourcetype=bar earliest=@d latest=@m
| eval period=case(_time>=relative_time(now(),"-1m@m"), "event in last minute",_time>=relative_time(now(),"-10m@m"), "event in last 10 minute",true(), "event daily")
| stats count by period

View solution in original post

0 Karma

somesoni2
Revered Legend

Try like this (update the first line of search per your's, keep the same earliest and latest)

index=foo sourcetype=bar earliest=@d latest=@m
| eval period=case(_time>=relative_time(now(),"-1m@m"), "event in last minute",_time>=relative_time(now(),"-10m@m"), "event in last 10 minute",true(), "event daily")
| stats count by period
0 Karma

akhasriya
Engager

Works great, thank you.

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...