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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...