Dashboards & Visualizations

Why is Splunk query to extract string inside XML tag not working with spath command?

maximusdm
Communicator

I am using the following query:

index=itx "PAD =" | dedup BOC | spath output=Channel path=AsRunMessage.Header.Channel  | table BOC, channel

which results in events with big XML content .. I need to extract the string "ITX1546" from inside the tags.

Also, I need to create a table with distinct rows containing unique BOC values.

The Channel field is not being populated.

Here is the XML structure:

alt text

Any ideas? Thank you

0 Karma
1 Solution

maximusdm
Communicator

found my own answer.. .rex "]+>(?[^<]+)"

View solution in original post

0 Karma

maximusdm
Communicator

found my own answer.. .rex "]+>(?[^<]+)"

0 Karma

maximusdm
Communicator
rex "<Channel [^>]+>(?<Channel>[^<]+)"
0 Karma
Get Updates on the Splunk Community!

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

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...