All Apps and Add-ons

Memory and CPU Dashboard Field Error

richardphung
Communicator

I get an error on the Memory and CPU Dashboard--- "Field 'fields' does not exist in the data."

alt text

index=extnet | dedup host  | rex max_match=0 "(MSM-(?<slotMSM>\w+)\s+|MM-(?<slotMM>\w+)\s+|Slot-(?<slotNum>\w+)\s+|)Total(\sDRAM\s|\s+)\(KB\):\s+(?<totalDRAM>\d+)"   | rex max_match=0 "(MSM-\w+\s+|MM-\w+|Slot-\w+\s+|)System\s+\(KB\):\s+(?<sysDRAM>\d+)"   | rex max_match=0 "(MSM-\w+\s+|MM-\w+|Slot-\w+\s+|Slot-\w+\s+|)User\s+\(KB\):\s+(?<userDRAM>\d+)"   | rex max_match=0 "(MSM-\w+\s+|MM-\w+|Slot-\w+\s+|Slot-\w+\s+|)Free\s+\(KB\):\s+(?<freeDRAM>\d+)"  | eval memSlot=if(isnotnull(slotMSM),slotMSM,memSlot) | eval memSlot=if(isnotnull(slotNum),slotNum,memSlot) | eval memSlot=if(isnotnull(slotMM),slotMM,memSlot) | eval fields=mvzip(totalDRAM,freeDRAM) | eval fields=if(isnotnull(memSlot),mvzip(fields,memSlot),fields) | mvexpand fields | rex field=fields "(?<fieldTotal>\w+),(?<fieldFree>\d+)(,(?<fieldSlot>\d+)|)" | eval pctFree=round((fieldFree/fieldTotal)*100,2) | where pctFree<50 | eval fieldTotal=round(fieldTotal/1024,2) | eval fieldFree=round(fieldFree/1024,2) | eval eventTime=strftime(_time,"%Y-%m-%d %H:%M:%S") | table host,fieldSlot,fieldTotal,fieldFree,pctFree,eventTime | sort +pctFree | rename host as "IP Address" fieldSlot as "Slot" fieldTotal as "Total DRAM (MB)" fieldFree as "Free DRAM (MB)" pctFree as "Percent DRAM Free" eventTime as "Latest Update"

This looks like a syntax issue around:

mvexpand fields
0 Karma

richardphung
Communicator

I think this has something to do with the multivalue field being null...

index=extnet | dedup host  
| rex max_match=0 "(MSM-(?<slotMSM>\w+)\s+|MM-(?<slotMM>\w+)\s+|Slot-(?<slotNum>\w+)\s+|)Total(\sDRAM\s|\s+)\(KB\):\s+(?<totalDRAM>\d+)"   
| rex max_match=0 "(MSM-\w+\s+|MM-\w+|Slot-\w+\s+|)System\s+\(KB\):\s+(?<sysDRAM>\d+)"   
| rex max_match=0 "(MSM-\w+\s+|MM-\w+|Slot-\w+\s+|Slot-\w+\s+|)User\s+\(KB\):\s+(?<userDRAM>\d+)"   
| rex max_match=0 "(MSM-\w+\s+|MM-\w+|Slot-\w+\s+|Slot-\w+\s+|)Free\s+\(KB\):\s+(?<freeDRAM>\d+)"  
| eval memSlot=if(isnotnull(slotMSM),slotMSM,memSlot) 
| eval memSlot=if(isnotnull(slotNum),slotNum,memSlot) 
| eval memSlot=if(isnotnull(slotMM),slotMM,memSlot) 
| eval attr=mvzip(totalDRAM,freeDRAM) 
| eval attr=if(isnotnull(memSlot),mvzip(attr,memSlot),attr)
| mvexpand attr 

In this context.... the search doesn't yield anything for slotMSM, slotNum, or memSlot.
Or at least, these weren't returned as extracted fields.
so when it tries to mvzip, it is basically stitching together null, null.

0 Karma

kmaron
Motivator

If you rename fields to something else does it work? I can't help but think it doesn't like the field name being fields.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...