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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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