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!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...