Splunk Search

Can we run the query for 100 or so hosts?

danielbb
Motivator

We have the following that runs nicely for one host -

index=<index name> host=<host name> source=<source name> sourcetype=<sourcetype name> earliest=-7d MaximumProcessAddressSpace 
| stats first(MaximumProcessAddressSpace) as AvailableMEM 
| return AvailableMEM

We would like to do it for 100 or so hosts. Any ideas?

Tags (1)
0 Karma

aberkow
Builder

Unclear if you're looking for something more complex, but running the stats command BY host should split this out by host. You can also inputlookup a csv that acts as an IN clause for specific hosts. Examples:

index=<index name>  source=<source name> sourcetype=<sourcetype name> earliest=-7d MaximumProcessAddressSpace 
 | stats first(MaximumProcessAddressSpace) as AvailableMEM BY host

OR

  index=<index name>  source=<source name> sourcetype=<sourcetype name> earliest=-7d MaximumProcessAddressSpace 
[ |inputlookup hostsICareAbout.csv
    |table host]
    | stats first(MaximumProcessAddressSpace) as AvailableMEM BY host

Do these make sense as options/answer your question?

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...