Dashboards & Visualizations

How can we convert raw event to XML format in Splunk?

nerelluk
New Member

I want to convert a raw event into an XML viewer format in Splunk. The event is of 30-40 lines.

Sample Event:

Tags (2)
0 Karma

woodcock
Esteemed Legend

You have 2 main tools, but keep in mind that you may have to shape your _raw field before either of them will work:
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Spath
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Xpath

0 Karma

jkat54
SplunkTrust
SplunkTrust

Try using xmlkv, xpath, rex, and/or extract search commands. See if that's what you want.

Also make sure your view is set correctly.

There's table, list, and raw views (selectable with a drop down at the top of the list of events). Raw view will not render the syntax highlighting.

Also fast mode will not auto-extract fields unless they are indexed fields.

0 Karma

niketn
Legend

@nerelluk your requirement is to parse and extract XML data or to show the same as more readable xml format (visualization)?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

nerelluk
New Member

yes ..could you please help me in this

0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

Hi @nerelluk,

In splunk dashboard you can use HTML and JS - Ref. Add HTML and JS file and use that JS file to display XML content on to the dashboard. For search result you can handle search result from JS. You can use good libraries to display XML nicely.

Hope this helps!!!

0 Karma

nerelluk
New Member

Thanks for the info VatsalJagani

it would be helpful for me if you can brief me...

I am not familiar with JS...

Regards,
Nerellu

0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

@nerelluk - If you are not much familiar with JS it might take long time to create the feature that you asked for as it is not very straight forward requirement. But some references you can refer for quick start.

How to run search from JS?
And for xml viewer I've already mentioned Js library in the answer.

0 Karma

nerelluk
New Member

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxdsdsassasacdasdxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...