Splunk Search

How to extract part of an XML message from the log file in the form of a table?

ravikanthbapath
New Member

Hi,

I have a log file named Audit.Log and has content something like below.
< AuditLog >
< Comp name="samsung"/ >
< Actor name="actor"/ >
< User name="reguser"/ >
< LogComments> This is a test message< / LogComments >
< TimeStamp="455454545xxx"/ >
< / AuditLog >

I would want to retrieve the data as

This is a test message , reguser in the form of a table.

could someone throw some light onto the same, I am not much familiar with the splunk commands.

0 Karma

dineshraj9
Builder

Try | xmlkv in your search. It will extract all tags as fields with corresponding values on the left. Then you can format your query to show it as table.

Reference : http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Xmlkv

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...