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

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!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...