Splunk Search

Timechart of max(variable) - get actual time of peak, instead of bin time

sperl
New Member

When I do a timechart - I get the max of my variable in the chart.

However, if I hover over the value - the time associated is the bin time of the timechart and not the actual time of the event.

i.e. for a 24 hour search
timechart max(latency) span=30m

If I had an event measuring 1500 at 10:37:45 which was the max in that bin, it will chart 1500, but it will timestamp at 10;30, the beginning of the bin.

How do I get it to show the actual event _time ?

Tags (1)
0 Karma

somesoni2
Revered Legend

Give this a try

your base search 
| eventstats max(latency) as max 
| eval MaxTimestamp=if(latency=max,_time,null())
| timechart span=30m max(latency) as maxLatency values(MaxTimestamp) as MaxTimestamp values(max) as max
| appendpipe [| dedup MaxTimestamp max | eval _time=MaxTimestamp | eval maxLatency =max ]
| table _time maxLatency | sort _time
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...