Splunk Search

find maximum value of a field by host over the last 7 days

arrangineni
Path Finder

I need am trying to find the maximum value of a field(Peak value and time at which it happened everyday) based on a other field for the last seven days, I am using the time chart to get the values of the field but I need the exact time of the filed when it occurred rather than only the day. Can someone help me with this?

Need the know what is the Peak Processing time of hosts and the time when that is occurring.

index=perfmon sourcetype="Perfmon:" host=A OR host=B OR host=C OR host=D object="Processor" counter="% Processor Time" instance=""
| timechart span=1d max(Value) as Peak by host

which gives results as,

_time A B C D
2018-10-10 45 67 6 56
2018-10-11 12 45 56 45
2018-10-12 79 78 34 67

0 Karma

Vijeta
Influencer

Try the below query, you can do transpose if needed

index=perfmon sourcetype="Perfmon:" host=A OR host=B OR host=C OR host=D object="Processor" counter="% Processor Time" instance="" 
|  eval date= strftime(_time,"%Y-%m-%d")

|  sort - 0 date host Value
| dedup   date host
| table _time Value host
0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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