Splunk Search

Splunk query help - CPU Load - Need to change query for negative values

splunker9999
Path Finder

Hi,

We have splunk query to find CPU load like

| eval pctCPULoad=round(100 - pctIdle,2) , and we used condition if value >=95 to trigger an alert.

Here,in our case pctIdle value we have is "195",hence we are getting pctCPULoad as "-95"

Although it is -95 we are getting alerts as this is considering as 95?

Can someone help?

Thanks

Tags (1)
0 Karma
1 Solution

javiergn
Super Champion

Why don't you do it this way as having a computer idle more than 100% of the time does make too much sense?

| eval pctCPULoad=if(pctIdle >= 100, 0, round(100 - pctIdle,2))

View solution in original post

0 Karma

javiergn
Super Champion

Why don't you do it this way as having a computer idle more than 100% of the time does make too much sense?

| eval pctCPULoad=if(pctIdle >= 100, 0, round(100 - pctIdle,2))
0 Karma

splunker9999
Path Finder

Nice thought. Will do

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...