All Apps and Add-ons

REST API modular input xml data parsing

leeyounsoo
Path Finder

hello splunk
i have a question that About extracting by specifying sourcetype in props.conf.
i want parsing xml data that Xml data received in response
but that data is not parsing

this is my develop environment
1. use REST API
- use REST API modular input
- Every 300 seconds https call setting
- index=main sourcetype=ex_st
- install in heavy Forwarder

  1. cluster
  2. 1 search head (heavy forwarder and indexer master in 1 search header)
  3. 2 indexer(cluster)
  4. props.conf [xmlData] category = Custom SHOULD_LINEMERGE = true KV_MODE = xml disabled = false TRUNCATE = 0 BREAK_ONLY_BEFORE = NO_BINARY_CHECK = true description = XML Data Field extract
  5. received xml data sample

alt text

0 Karma
1 Solution

leeyounsoo
Path Finder

I knew why it was not automatically parsed and I solved it.

The reason it has not been parsed is that the XML data passed to the response is so large that the event is restricted and the XML structure is corrupted.

i modified the "TRUNCATE" setting to include all the XML data in one event so that it was automatically parsed.

Here is the props.conf configuration.

[xml_data]
KV_MODE = xml
# BREAK_ONLY_BEFORE = \<data_list_wrap
BREAK_ONLY_BEFORE = \ <\? Xml version = \ "1 \ .0 \" encoding = \ "UTF-8 \" \?
SHOULD_LINEMERGE = true
TRUNCATE = 70000

View solution in original post

leeyounsoo
Path Finder

I knew why it was not automatically parsed and I solved it.

The reason it has not been parsed is that the XML data passed to the response is so large that the event is restricted and the XML structure is corrupted.

i modified the "TRUNCATE" setting to include all the XML data in one event so that it was automatically parsed.

Here is the props.conf configuration.

[xml_data]
KV_MODE = xml
# BREAK_ONLY_BEFORE = \<data_list_wrap
BREAK_ONLY_BEFORE = \ <\? Xml version = \ "1 \ .0 \" encoding = \ "UTF-8 \" \?
SHOULD_LINEMERGE = true
TRUNCATE = 70000

Damien_Dallimor
Ultra Champion

Is that XML above an example of what you want to be indexed ?

0 Karma

leeyounsoo
Path Finder

yes.
i want parsing event from that one xml data
like this :

  1. event parsing
  2. event parsing by "data" tag

----------1st evnet ----------
data
...(skip)
/data

----------2nd evnet ----------
data
...(skip)
/data

  1. field extraction
  2. fields data_tag0, data_tag1, data_tag2 ....(skip)
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2026-2027 SplunkTrust is officially open. If ...