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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...