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

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...