Splunk Search

How to ignore the most recent X number of events from a search for each day with Timechart command

jboustead
Explorer

Hi

Is there a search command that will ignore the most recent X number of events for each day whilst using a Timechart command?

Thanks

Labels (1)
0 Karma
1 Solution

rnowitzki
Builder

Hi @jboustead ,

Before you run the timechart, add this:

|  streamstats count as remove_trigger by date_mday  reset_on_change=true
|  where remove_trigger>3

This would remove the 3 latest/most recent events per day.

 Make sure it works if the month changes in the events (and you have 2 different days with "1" as date_mday for example), because I am not sure. You would have to add the month to the streamstats maybe.

Hope it helps.
BR

Ralph 

--
Karma and/or Solution tagging appreciated.

View solution in original post

rnowitzki
Builder

Hi @jboustead ,

Before you run the timechart, add this:

|  streamstats count as remove_trigger by date_mday  reset_on_change=true
|  where remove_trigger>3

This would remove the 3 latest/most recent events per day.

 Make sure it works if the month changes in the events (and you have 2 different days with "1" as date_mday for example), because I am not sure. You would have to add the month to the streamstats maybe.

Hope it helps.
BR

Ralph 

--
Karma and/or Solution tagging appreciated.
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...