Splunk Search

Show events that occur in particular order

Fallingacorn
Engager

Hi all,

I'm fairly new to splunk and was wondering if someone could point me in the direction I need to go. I'm having trouble with making searches that will show when event A occurs and then event B occurs after within a time frame. The after part is crucial as the inverse occurrence is less important to us.

Some examples:

  • A system has a log in the antivirus malware index then within a short period of time has over 100 blocked websites (logs in proxy index)
  • A system has downloaded a file (logs in proxy index) then within a short period of time has over 100 blocked websites (logs in proxy index)
  • A system has a log in the ids index then within a short period of time has excessive blocks on the firewall (logs in firewall index)

I don't need help formulating the pieces of the search, such as how to find if there are 100 blocked sites or if a file was downloaded. The bigger issue is how do I say if event A and after event B occurs within a specific time range.

Thanks,
Kim

Tags (3)
0 Karma
1 Solution

lguinn2
Legend

The join command can be used to combine the results of two searches - and to restrict the time-ordering. Usually I suggest that people try to combine searches and avoid join, since it can be slow.

But for this situation, the join command might be helpful and easier than something like delta. This kind of search might do what you want...

index=antivirus "malware event"
| join host usetime=T earlier=F [ search index=proxy "blocked event" 
     | stats count earliest(_time) as _time by host 
     | where count > 100 ]

View solution in original post

lguinn2
Legend

The join command can be used to combine the results of two searches - and to restrict the time-ordering. Usually I suggest that people try to combine searches and avoid join, since it can be slow.

But for this situation, the join command might be helpful and easier than something like delta. This kind of search might do what you want...

index=antivirus "malware event"
| join host usetime=T earlier=F [ search index=proxy "blocked event" 
     | stats count earliest(_time) as _time by host 
     | where count > 100 ]

somesoni2
Revered Legend

You can use delta command on _time field to calculate time difference between two events. Once you filter the events you need and calculate time difference, (+ve time diff means they occurred after each other) and do more processing. More details of search/data will be helpful here to provide more to the point answers.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...