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.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...