Dashboards & Visualizations

Website Input: JSP XML document

johnsmits
New Member

I would like to get data using CSS Selector from the following section of the JSP XML document

JSP XML document is as follow:

alt text

Desired data result is: The queue name, the value of the size, the value and the value of consumerCount from the queue name "mdm.inbound".
example : queue name = "mdm.inbound", size="100", consumerCount="4"

Which CSS Selector could I use to get the desired data result ?
Otherwise, is it possible to use spath to get the result ?

Thanks,
Karada

Tags (4)
0 Karma

to4kawa
Ultra Champion
| makeresults
| eval _raw="<queues>
<queue name=\"mdm.inbound\">
<stats size=\"100\" consumerCount=\"4\" enqueueCount=\"5\" dequeueCoun=\"6\"/>
<feed>
<atom>
queueBrowse/mdm.inbound?view=rss&amp;feedType=atom_1.0
</atom>
<rss>
queueBrowse/mdm.inbound?view=rss&amp;feedType=rss_2.0
</rss>
</feed>
</queue>

<queue name=\"notification-mst\">
<stats size=\"20\" consumerCount=\"30\" enqueueCount=\"40\" dequeueCoun=\"50\"/>
<feed>
<atom>
queueBrowse/mdm.inbound?view=rss&amp;feedType=atom_1.0
</atom>
<rss>
queueBrowse/mdm.inbound?view=rss&amp;feedType=rss_2.0
</rss>
</feed>
</queue>
</queues>"
| spath path="queues.queue{@name}" output=queue_name
| spath path="queues.queue.stats{@size}" output=size
| spath path="queues.queue.stats{@consumerCount}" output=consumerCount
| eval tmp=mvzip(queue_name,mvzip(size,consumerCount))
| fields - _*
| stats count by tmp
| eval queue_name=mvindex(split(tmp,","),0), size=mvindex(split(tmp,","),1) , consumerCount=mvindex(split(tmp,","),2)
| table queue_name size consumerCount

hi @johnsmits
I extracted it.

0 Karma

codebuilder
Influencer

If you are performing search time field extractions, set kvmode=xml in props.conf.
Worth noting, by default kvmode=auto, and may not always interpret your structure properly (and/or create unwanted extractions).

----
An upvote would be appreciated and Accept Solution if it helps!
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 ...