Splunk Search

Is it possible to fetch events from bar index in 5 seconds after event in foo index?

RiberaJoice
Splunk Employee
Splunk Employee

I have a query to fetch account create endpoint and errors after

 

(index=foo "account/create") OR (index=bar ERROR)

 

But right part of OR would return all errors in time frame.

Is it possible to fetch events from bar index in 5 seconds after event in foo index?

I found Localize function, but looks like it works only in same index

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

You can do that with the map command. 

(index=foo "account/create") 
| eval earliest=_time, latest=_time + 5
| map search="index=bar ERROR earliest=$earliest$ latest=$latest$"

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Happy CX Day to our Community Superheroes!

Happy 10th Birthday CX Day!What is CX Day? It’s a global celebration recognizing innovation and success in the ...

Check out This Month’s Brand new Splunk Lantern Articles

Splunk Lantern is a customer success center providing advice from Splunk experts on valuable data insights, ...

Routing Data to Different Splunk Indexes in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...