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!

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...