Splunk Search

How do I get my transaction search to use the first start event as the starting point?

jaihind_nalla
New Member

Hi,
i have log file
and i am using startswith Starting Dispatcher and endswith completed.
but some times in the log there are 2 Starting dispatcher, so i want the transaction to consider first start , so that i will get correct duration.

appreciate help.

Thanks,
Jai

0 Karma

to4kawa
Ultra Champion
index=your_index sourcetype=your_sourcetype  "Starting Dispatcher" OR "completed"
| streamstats count(eval("Starting Dispatcher")) as session by transaction_keyword
| stats earliest(_time) as start latest(_time) as end range(_time) as duration count as flag by transaction_keyword session
| where flag > 1

Hi, @jaihind_nalla
start , end , duration are UNIX epoch time.
you can use convert or strftime

0 Karma

martynoconnor
Communicator

Can you give me an example of the search you're currently using and I'll see if I can rework it to use stats instead of transaction. Transaction is a very costly search command, and you will almost always get better performance using stats instead.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...