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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...