Splunk Search

serach string combination

Splunk_U
Path Finder

I want to create a sreach string that will provide the avegCPU util, PeakCPU util, AvgMem util and PeakMem util.
I have created four different search string. How to combine them?

average memory usage
index=os sourcetype=vmstat | multikv fields memUsedPct | stats avg(memUsedPct) by host

peak memory usage
index=os sourcetype=vmstat | multikv fields memUsedPct | stats max(memUsedPct) by host

average CPU usage
index=os sourcetype=cpu | multikv fields pctIdle | search all | eval Percent_CPU_Load = 100 - pctIdle | stats avg(Percent_CPU_Load) as Average by host

Peak CPU usage
index=os sourcetype=cpu | multikv fields pctIdle | search all | eval Percent_CPU_Load = 100 - pctIdle | stats max(Percent_CPU_Load) as Peak by host

HELP me out!!!!

Tags (2)
0 Karma
1 Solution

lguinn2
Legend

This should do it:

index=os sourcetype=vmstat 
| multikv fields memUsedPct  
| stats avg(memUsedPct) max(memUsedPct) by host
| join host [ search index=os sourcetype=cpu 
    | multikv fields pctIdle  
    | search all  
    | eval Percent_CPU_Load = 100 - pctIdle  
    | stats avg(Percent_CPU_Load) as Average max(Percent_CPU_Load) as Peak  by host ]

View solution in original post

lguinn2
Legend

This should do it:

index=os sourcetype=vmstat 
| multikv fields memUsedPct  
| stats avg(memUsedPct) max(memUsedPct) by host
| join host [ search index=os sourcetype=cpu 
    | multikv fields pctIdle  
    | search all  
    | eval Percent_CPU_Load = 100 - pctIdle  
    | stats avg(Percent_CPU_Load) as Average max(Percent_CPU_Load) as Peak  by host ]
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Unmerging HTML Tables

[Puzzles] Solve, Learn, Repeat: Unmerging HTML TablesFor a previous puzzle, I needed some sample data, and ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...

AI for AppInspect

We’re excited to announce two new updates to AppInspect designed to save you time and make the app approval ...