Getting Data In

Handling breaking and field extraction from Header section plus Repeated sections in XML

rickferrante
Explorer

Hi, 
We need to forward XML documents from a UF to indexers that have key fields both in a one-time header  section and in a repeated section that can be repeated up to 100,000 times.  So, for example, the file could look like:

<PUBS>
<HEADER><Identifier>93234</Identifier>
<REPEATSECTION><Balance>8751.23</Balance></REPEATSECTION>
<REPEATSECTION><Balance>943.43</Balance></REPEATSECTION>
... note: repeats up to 100,000 times with many many more fields than shown here. Total file size >=300mb...
<REPEATSECTION><Balance>123.233</Balance></REPEATSECTION>
</PUBS>

If the UF breaks events before  <REAPEATSECTION>, then we could have one splunk event per REPEAT section but the fields in the HEADER would not be available. 

If the UF sends the whole 300mb file to an indexer,  is there a configuration of props/transforms on the indexer that can create one splunk event per REPEATSECTION but also get the fields from the HEADER section?

I'm trying to ask a good question here as best i can.  Does my question make sense to anyone?

Thanks!

Labels (1)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

The question is understandable. The answer however is that you can't do that reliably with splunk's built-in functionalities. Splunk processes one event at a time and doesn't keep any state which could be carried from one event to another. You can sometimes do some magic with cloning events and cutting different parts from each copy but that hack is ugly, non-scallable and inefficient.

View solution in original post

PickleRick
SplunkTrust
SplunkTrust

The question is understandable. The answer however is that you can't do that reliably with splunk's built-in functionalities. Splunk processes one event at a time and doesn't keep any state which could be carried from one event to another. You can sometimes do some magic with cloning events and cutting different parts from each copy but that hack is ugly, non-scallable and inefficient.

Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...