Splunk Search

Find time range matching events in another log - subquery?

mvgetz
Engager

I am new to splunk and cannot figure out how to do this - I have start and end transactions in a webAPI log that I pull with a query. What I need to do is get all the events from an engine log that occur during each transaction. No other matching fields between the two logs except time. Here is my main query -

source="rest.log" | transaction sessionId maxevents=2 | where duration>10

I am envisioning a subquery that would do something like: source="engine" maxtime=transactionmaxtime mintime-transactionmintime

Any help would be appreciated. Thanks.

lguinn2
Legend

I am no expert with the map command, but you could try this:

source="rest.log" 
| transaction sessionId maxevents=2 | where duration > 10
| eval starttime =strftime(_time,"%m/%d/%Y:%H:%M:%S")
| eval endtime =strftime(start + duration"%m/%d/%Y:%H:%M:%S")
| map search="search source::engine earliest::$starttime$ latest::$endtime$" maxsearches=100
0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...