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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...