Dashboards & Visualizations

How to have one event per XML file and how to read it completely?

Path Finder


We have kept the monitoring on the directory where XML files are placed. We would like to have one event per XML file but its getting split into multiple events. Also only few lines of xml file is getting into splunk.

Can anyone suggest how we can get the complete file in Splunk ?


0 Karma

Path Finder

I would set up your inputs and props with the following configuration (replacing the ## variables with what matches your case):


[monitor://#path to your files#]
sourcetype = #your sourcetype#


MAX_TIMESTAMP_LOOKAHEAD = #timestamp character count#
LINE_BREAKER = SaveRetailItemSalesLocation\>([\r\n\s]+)
TIME_FORMAT = #timestamp Format#
TIME_PREFIX = TransactionDate\>
TRUNCATE = #max size of your events#
KV_MODE = xml

If you put the props.conf on your search heads, indexers, and forwarders, you should get events that use the TransactionDate as their timestamp, with all their fields auto-extracted in spath format. I made assumptions on the timestamp field, which can be adjusted if you need a different field to act as the timestamp.

0 Karma

Path Finder

Just to clarify: your XML files should be read as a single event per file? Can you post an example of the XML structure?

0 Karma

Path Finder

yes , single event per file.

0 Karma
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!