Getting Data In

Extracting XML data attributes from message field

paddy3883
Path Finder

I have XML data stored for an field in my Splunk events and am looking to extract an attribute contained within one of the elements For example, an event will look like


LogName=Application
SourceName=MyApplication
Type=Error
Message=<Exception type="SomeType.Value" message="The value I wanted" ....></Exception>
....

How can I extract the message attribute values for the matching events?

Tags (1)
0 Karma
1 Solution

asimagu
Builder

a regex will always do the magic you need

| rex "\smessage=\"(?P<FIELDNAME>[^\"]+)\""

View solution in original post

0 Karma

asimagu
Builder

a regex will always do the magic you need

| rex "\smessage=\"(?P<FIELDNAME>[^\"]+)\""
0 Karma

paddy3883
Path Finder

Excellent, many thanks. This worked a treat

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...