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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...