Splunk Search

How to edit my search to show stats by host?

sunnyparmar
Communicator

Hello,

In the below given search, I want to show data by "host", so please could anybody suggest me how to do this?

index=sc-perfmon sourcetype="Perfmon*" counter="Free Megabytes" OR "User Time" OR "Available MBytes" | stats sparkline, latest(_time) as latest_event by sourcetype | eval "time since latest event"=((now() -latest_event)/60)| sort "time since latest event" | fieldformat latest_event = strftime(latest_event, "%F %T")

Thanks
Ankit

Tags (2)
0 Karma
1 Solution

woodcock
Esteemed Legend

Try this:

index=sc-perfmon sourcetype="Perfmon*" counter="Free Megabytes" OR "User Time" OR "Available MBytes" | stats sparkline, latest(_time) as latest_event by sourcetype, host | eval "time since latest event"=((now() -latest_event)/60)| sort "time since latest event" | fieldformat latest_event = strftime(latest_event, "%F %T")

View solution in original post

woodcock
Esteemed Legend

Try this:

index=sc-perfmon sourcetype="Perfmon*" counter="Free Megabytes" OR "User Time" OR "Available MBytes" | stats sparkline, latest(_time) as latest_event by sourcetype, host | eval "time since latest event"=((now() -latest_event)/60)| sort "time since latest event" | fieldformat latest_event = strftime(latest_event, "%F %T")

sunnyparmar
Communicator

Thanks a lot buddy.. it works..

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...