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
Take the 2021 Splunk Career Survey

Help us learn about how Splunk has
impacted your career by taking the 2021 Splunk Career Survey.

Earn $50 in Amazon cash!