Splunk Search

Can you help me with extract fields from the following WMIC log files?

rfellmann
New Member

I've got wmic logfiles which look like this:

Name Vendor Version

Java 8 Update 172 (64-bit) Oracle Corporation 8.0.1720.11
Java 8 Update 181 Oracle Corporation 8.0.1810.15

Java Auto Updater Oracle Corporation 2.8.172.11

alt text

  • Header is always the same
  • The logs can have more than one row (some have up to 5)
  • The actual data rows are always separated by two or more whitespaces

What's the proper way to extract these fields? I managed to extract the first row using the rex command — but then, all other rows are ignored. Using multiple piped rex would result in having multiple field names (Name1, Name2, Name3 etc) for each row.

| rex field=_raw "^(\w+\s+)+(?P\w+\s+\d+\s+\w+\s+\d+)\s+(?P\w+\s+\w+)\s+(?P[^ ]+)"

Thank you!

0 Karma
1 Solution

FrankVl
Ultra Champion

One option would be to take a look at the multikv command, which is specifically designed for processing such data.
http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Multikv

View solution in original post

0 Karma

FrankVl
Ultra Champion

One option would be to take a look at the multikv command, which is specifically designed for processing such data.
http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Multikv

0 Karma

rfellmann
New Member

Brilliant thank you - exactly what I was looking for.

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 ...