Splunk Search

Getting the Date for the max() value

modulussplunk
Loves-to-Learn

Howdy I have a search like this:

modulussplunk_0-1641668543314.png

Everything is great!

 

Would it be possible to add a column that contains the timestamp for max(seconds) ?

I've googled and even tried out some solutions I found here but can't quite get it...

(i.e If I try to add "by host, _time" I get ALL the results). 

Thanks!

 

 

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eventstats max(seconds) as max median(seconds) as median ... by host
| where seconds=max
0 Karma

modulussplunk
Loves-to-Learn

Thanks so much. But it no longer shows any stats..

Do you want eventstats to replace stats entirely or pipe the whole previous search into eventstats as you list it below?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Eventstats replaces the stats - the ... means put the other stats in here too - that is, just replace stats with eventstats and then pipe to the where command

0 Karma

modulussplunk
Loves-to-Learn

Ah. I see. Thanks very much. I added table to the query and it appears all is well. Many thanks here!

 

My Final Query:

modulussplunk_0-1641754833770.png

 

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...