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!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...