Splunk Search

search showing times when raw events were 0

Skins
Path Finder

Looking to do a search which shows start time and end time when _raw events were 0 over a say 24hr period.

Trying to find out when and how often my events drop to 0 for specific hosts

gratzi

Tags (1)
0 Karma

FrankVl
Ultra Champion

I'd start with:

| tstats count where index=foo host=bar by _time | timechart sum(count) as count

And then either inspect a visualization, or do some further filtering on those results to find periods where count is 0.

0 Karma

xpac
SplunkTrust
SplunkTrust

You might need to add prestats=true right after tstats, don't you?

0 Karma

FrankVl
Ultra Champion

Why? I've never used that setting before to be honest. I just tried it but don't see what value it adds to just the plain approach I suggested?

0 Karma

xpac
SplunkTrust
SplunkTrust

From the docs:

Specifies whether to use the prestats format. The prestats format is a Splunk internal format that is designed to be consumed by commands that generate aggregate calculations. When using the prestats format you can pipe the data into the chart, stats, or timechart commands, which are designed to accept the prestats format. When prestats=true, AS instructions are not relevant. The field names for the aggregates are determined by the command that consumes the prestats format and produces the aggregate output.

I understood it as it is required for timechart etc. to properly work on tstats data, and at least once had trouble when not using it, because the output was wrong. Maybe it's only needed if you use specific features of timechart? Just wanted to mention it exists, in case you run into trouble when not using it 🙂

0 Karma

FrankVl
Ultra Champion

Yeah, I read that as well and it isn't really making it any clearer for me 😄

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...