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.
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