Splunk Search

How to define "latest" based on "earliest" in order to act on the group of events happening in a certain duration.

ahuseid
New Member

I have a search challenge where I need to pick a _time from SearchA and look for all the events happening in SearchB within a certain duration (few minutes). When I used "map" in SearchB with "earliest" taken from SearchA and "latest" to be "earliest" plus few minutes, it does not work at all. This is roughly what I used:

index=ABC sourcetype= STypeA | eval st=_time | map search="search index=ABC sourcetype=STypeB user=xyz earliest=$st$ | eval latest=$st$+3600"

Note that both searches do have same index (=ABC)

I appreciate your help.

Thanks.

Tags (3)
0 Karma

woodcock
Esteemed Legend

Try this:

index=ABC sourcetype= STypeA | eval lotime=_time | eval hitime=lotime+3600| map search="search index=ABC sourcetype=STypeB user=xyz earliest=$lotime$ latest=$hitime$"
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...