Splunk Search

fieldformat individually is a pain

NickJLange
Explorer

Related to my previous question on arbitrary lists of variables...

sum(CPU*) seems to pull off an interesting trick of
1.) enumerating all possible variables starting with CPU

Is there anyway to template their output name sum(CPU*) as CPU$BLAH$

which then leads to any way to do this en-masse for fieldformat?

right now I'm using excel to generate the field list... which is slightly complex and painful. Would love something simple/elegant...

0 Karma

sundareshr
Legend

You could try this

| stats sum(CPU*) AS CPU* | foreach CPU* [ eval <<FIELD>>= tostring(<<FIELD>>, "commas") ]
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...