Splunk Search

Alerting on free space AND % free space - Windows-based systems

jmo1
Path Finder

   We are collecting perfmon information - "Free Megabytes" and "% Free Space".  All is well in the collection on these items.  We have an alerts that alerts us when free space is less than 10 "Free Megabytes".  Again, all is well.

   I now need to modify the alert to report any hosts where "Free Megabytes" is less than 10 AND "% Free Space" is than 20.  (Numbers are just an example).  I trying but haven't gotten it to work.  Here is what I have in my testing...

 

 

sourcetype="Perfmon:Free Disk Space" instance!=_Total counter="% Free Space" Value<20 [ search host=* sourcetype="Perfmon:Free Disk Space" instance!=_Total counter="Free Megabytes" Value<10000 | return host ] | table host, instance, Value

 

 

 

Two concerns..

1.  I need to look at all hosts all drives but not _Total (which combines)

2.  I need to alert only if "Free Megabytes" < 10 and "% Free Space" <20

 

Any help would be appreciated.

Labels (1)
0 Karma
1 Solution

jmo1
Path Finder

Answering my own question..

  In order to get it to return all hits, you need to supply a count.  So rather than

return host

 

I need to add a 'count'.  I used 1000 as a safe number, it doesn't appear to matter if you don't have 1000 items, so guess big.

return 1000 host

 

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What does "haven't gotten it to work" mean?  Do you get errors?  If you get no results, have you confirmed there should be results?

At first glance, the query looks like it should work so you should verify you have data that meet the search criteria.

BTW, including an index name in the query will help improve performance.

---
If this reply helps you, Karma would be appreciated.
0 Karma

jmo1
Path Finder
Spoiler
Thanks for the response. I think part of my logic is sound, but if I run the following...

sourcetype="Perfmon:Free Disk Space" instance!=_Total counter="% Free Space" Value>0 [ search host=* sourcetype="Perfmon:Free Disk Space" instance!=_Total counter="Free Megabytes" Value>0 | return host ] | table host, instance, Value​


Which says basically, return all hosts/drives where Free Megabytes > 0 and % Free Space >0, which should return everything.  I get the return from a single host.

How do I get it to iterate through all of the hosts?  

And thanks for the index suggestion.

0 Karma

jmo1
Path Finder

Answering my own question..

  In order to get it to return all hits, you need to supply a count.  So rather than

return host

 

I need to add a 'count'.  I used 1000 as a safe number, it doesn't appear to matter if you don't have 1000 items, so guess big.

return 1000 host

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

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

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...