Splunk Search

Work out the duration between two fields

gracemaher
Explorer

Hi there.
I basically have a data set with Support Cases in, i would like to find out the duration between the case being created (New) and the case being closed (Resolved).

I have tried using eval/transaction and just cant get it to work.
can anyone help? 🙂
Thanks

Tags (2)
0 Karma

fdi01
Motivator

try

...| transaction Field_name startswith="New" endswith="Resolved"|eval duration = duration|...
0 Karma

woodcock
Esteemed Legend

The first answer using "stats" (not using "transaction") will be more effective (the max_span, etc. values are infinite) and also MUCH more efficient (quicker to run).

0 Karma

woodcock
Esteemed Legend

Let's say the field that you were using in your transaction command is "CorrelationField" then this should work:


... | stats earliest(_time) AS first latest(_time) AS last by CorrelationField | eval duration=last-first

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