Splunk Search

Combining field names into one new result name

Grant007701
New Member

Hi,

I'm trying to combine results of varying operating systems into one, for example:

Microsoft Windows Server 2008
Microsoft Windows Server 2008r2
Microsoft Windows Server 2012

All to be listed as

Windows Server

Does anyone know I may do this? I tried this but wouldn't work:

...chart count(signature) by operating-system | eval sort_field=case(operating-system=="Microsoft Windows*",Windows Server)

Tags (1)
0 Karma

manish_singh_77
Builder

Hi,

You can also use field aliases in this case, refer the below link for more info and let me know if it works for you.

https://docs.splunk.com/Documentation/Splunk/7.1.1/Knowledge/Addaliasestofields

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Three problems with your eval:

  1. operating-system would subtract system from operating - use single quotes to enclose non-standard field names.
  2. =="Microsoft Windows* looks for literal equality, use match() to allow regex-based matches.
  3. Windows Server should throw syntax errors, enclose strings in double quotes.

martin_mueller
SplunkTrust
SplunkTrust
0 Karma

Grant007701
New Member

Thanks for this.

Still struggling though, I have changed to the following:

...chart count(signature) by operating-system | eval sort_field=case('operating-system'=match('operating-system',"Microsoft*","Windows Server",0))

The arguments to the 'match' function are invalid.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...