Splunk Search

CPU Metrics JSON file already indexed - sum values under multilevel grouping by different multilevel names

ChrisFontana
Loves-to-Learn Lots

Hello,

This is my first question here, since I don't know how to look for the solution. I tried to resolve this case on the past three days, but I was not able to.

From the NJMON (JSON format for NMON) I got some multilevel fields and I'm trying to perform a graph to display the cpu utilization of sys, user, wait versus total (sys+wait+idle+user). The problem is not with the math, but how to group this information by CPU number level. This is how I got the structured data from NJMON:

cpu_physical: { [-]
     cpu0: { [-]
       idle: 0
       sys: 0
       user: 0
       wait: 0
     }

     cpu1: { [-]
       idle: 0
       sys: 0
       user: 0
       wait: 0
     }

     cpu10: { [-]
       idle: 0
       sys: 0
       user: 0
       wait: 0
     }

So, basically, I have the field: cpu_physical.cpu0.idle, cpu_physical.cpu0.sys, cpu_physical.cpu0.wait, cpu_physical.cpu0.user, cpu_physical.cpu1.idle, cpu_physical.cpu1.wait, cpu_physical.cpu1.sys, cpu_physical.cpu1.user ...

I could have in the same System 4 CPUs to 64 CPUs, so I cannot perform that only using | eval CPU0.idle+CPU0.wait+....

Basically, this is what I need as the final output in a table format:

CPU#  (Idle)  (Wait)  (Sys)  (user)

CPU0   10%  12%     13%    16%

CPU1  15%   15%     44%     67%

CPU2    XX%  16%     X%     X%

CPU3  XY%     X%       ...          ...  

 

So, with this results, I would be able to calculate the Wait+User+System / Wait+User+System+Idle per CPU.

 

Any hints or ideas about how to make this? Sorry if the text is quite confusing, I don't know how to explain it shortly and maybe this is why I was not able to find the solution.

 

Thank you very much!

 

 

Labels (2)
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 ...