Splunk Search

after bucketing, how to search/look for a threshold?

tedder
Communicator

The following tells me how many events I'm indexing every 5 minutes.

index="_internal" group="thruput" | bucket _time span=5m | timechart span=5m sum(instantaneous_eps) as ieps

I'd really like to finish this with a threshold, like this:

index="_internal" group="thruput" | bucket _time span=5m | timechart span=5m sum(instantaneous_eps) as ieps | ieps < 5000

..except that doesn't work.

Tags (1)
0 Karma
1 Solution

Lowell
Super Champion

First off, you don't need "bucket" when you are using timechart. You really only need "bucket" when you are using "chart" or "stats" and you need to do something fancy that you can't do with "timechart" out of the box; which is pretty rare.)

Looks like a "where" is all you are missing. Try this:

index="_internal" group="thruput" | timechart span=5m sum(instantaneous_eps) as ieps | where ieps < 5000

You can technically use a "where" clause directly in your timechart command, but you have to use a split-by clause for this to work. (I'm not 100% sure what the advantage is to doing this over simply using the where search command, but it's a viable option in any case.)

index="_internal" group="thruput" | timechart span=5m sum(instantaneous_eps) as ieps by host where ieps < 5000

View solution in original post

Lowell
Super Champion

First off, you don't need "bucket" when you are using timechart. You really only need "bucket" when you are using "chart" or "stats" and you need to do something fancy that you can't do with "timechart" out of the box; which is pretty rare.)

Looks like a "where" is all you are missing. Try this:

index="_internal" group="thruput" | timechart span=5m sum(instantaneous_eps) as ieps | where ieps < 5000

You can technically use a "where" clause directly in your timechart command, but you have to use a split-by clause for this to work. (I'm not 100% sure what the advantage is to doing this over simply using the where search command, but it's a viable option in any case.)

index="_internal" group="thruput" | timechart span=5m sum(instantaneous_eps) as ieps by host where ieps < 5000
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...