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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...