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!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Building Momentum: Splunk Developer Program at .conf25

At Splunk, developers are at the heart of innovation. That’s why this year at .conf25, we officially launched ...