Getting Data In

Is it possible to index XML files in a structured manner?

rsimmons
Splunk Employee
Splunk Employee

Is it possible to index XML files in a structured manner and if so how?

Tags (1)
1 Solution

amit_saxena
Communicator

Hi,

I actually would like to know why you want to do that. Perhaps that would make things more clear.

Anyway, regarding your query, if the data is getting generated at a host where heavy forwarder or indexer is installed, you can use scripts to transform the data from XML to CSV and then index CSV they way you do it regularly. That requires some scripting effort but it will be worth it.

It also depends a lot of the syntax of the XML file.

One more option is to use a tool like "Xalan" or equivalent tool which would read the XML along with customized XSL and then output a flat file which can be easily read by Splunk.

Regardless of whichever solution you choose, it will not be generic and hence specific for specific XMLs.

Let me know if it helps.

Regards,
Amit Saxena

View solution in original post

amit_saxena
Communicator

Hi,

I actually would like to know why you want to do that. Perhaps that would make things more clear.

Anyway, regarding your query, if the data is getting generated at a host where heavy forwarder or indexer is installed, you can use scripts to transform the data from XML to CSV and then index CSV they way you do it regularly. That requires some scripting effort but it will be worth it.

It also depends a lot of the syntax of the XML file.

One more option is to use a tool like "Xalan" or equivalent tool which would read the XML along with customized XSL and then output a flat file which can be easily read by Splunk.

Regardless of whichever solution you choose, it will not be generic and hence specific for specific XMLs.

Let me know if it helps.

Regards,
Amit Saxena

lguinn2
Legend

I am not clear what you mean by "structured" in this question. If we could see some sample data and get idea of the structure that you want - then Splunk can almost certainly do that.

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...