Splunk Search

With the transaction command, how do I get the duration between the first startswith to the last endswith?

xindeNokia
Path Finder

query like below:

| transaction startswith="Init" endswith="FINISHED" by ip
| table duration ip

Each IP has multiple "init" and "finish". Is there a way to group the first "init" to the last "Finished" instead of grouping the closest two?

Thanks in advance!

0 Karma
1 Solution

renjith_nair
Legend

@xindeNokia,

Try stats

"your search"  "init" OR "finished" |stats earliest(_time) as first,latest(_time) as last by ip|eval duration=last-first
Happy Splunking!

View solution in original post

0 Karma

renjith_nair
Legend

@xindeNokia,

Try stats

"your search"  "init" OR "finished" |stats earliest(_time) as first,latest(_time) as last by ip|eval duration=last-first
Happy Splunking!
0 Karma

xindeNokia
Path Finder

it works, thank you very much! much appreciated!

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...