Getting Data In

To calculate difference of first event and last event in the log

angalakuditived
Loves-to-Learn

Hi ,

 

I have to calculate the time difference between first event and last event for a particular flow in log I have used earliest (_time) and latest(_time) which gave me correct data.

Index= * | stats earliest(_time) as Earliest and latest (_time) as Latest 

Gave output in epoch Times but I need difference of Earliest and Latest,tried using diff and eval diff to strf time but no luck.

 

Can someone help me with the query please

 

 

 

 

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Doesn't this give you the difference (in seconds)?

| eval diff=Latest-Earliest
0 Karma
Get Updates on the Splunk Community!

Index This | What did the zero say to the eight?

June 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

Splunk Observability Cloud's AI Assistant in Action Series: Onboarding New Hires & ...

This is the fifth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Now Playing: Splunk Education Summer Learning Premieres

It’s premiere season, and Splunk Education is rolling out new releases you won’t want to miss. Whether you’re ...