Splunk Search

Need a query for the same event repeated in a defined time

esaionz
New Member

Hi,
I need a query to show me all occurrances when the same message is logged within 200ms.
Log example:

Message="Landed on page"
xxxxxx
yyyyyyy
Message="Landed on page"
zzzzzzz
uuuuu
jjjjjjjjjjj
Message="Landed on page"

I need to show all Message="Landed on page" which happened only with 200ms time from each other.
Thanks!

0 Karma

DalJeanis
Legend

try this. (replace with the actual index and sourcetype)

index=myindex sourcetype=something Message="Landed on page"
| streamstats current=f window=1 last(_time) as next_time by Message
| reverse
| streamstats current=f window=1 last(_time) as last_time by Message
| where (next_time < _time + 0.2) OR (laxt_time > _time - 0.2) 

This will give you every Message that is within 200 ms (0.2 second) of another of the same Message.

0 Karma

to4kawa
Ultra Champion

use streamstats range() and select with where

0 Karma

esaionz
New Member

I'm new to Splunk, how should I use it?. index=* message where message is repeated within 200ms. Thanks.

0 Karma

to4kawa
Ultra Champion

see reference and try examples. and then, make your query.
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Streamstats
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Where

your log is unclear. so , you should make query yourself.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...