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
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...