Getting Data In

BREAK_ONLY_BEFORE not working with XML input

badrsplunk
New Member

Hi,
I have an XML file input with the following form:

<data>
  <record>
   <field name="X" value="vX1">
   <field name="Y" value="vY1">
  </record>
  <record>
   <field name="X" value="vX2">
   <field name="Y" value="vY2">
  </record>
 </data>

In order to extract fields, I want to split this input to one event per each record. to do this, I tried this in props.conf:

      [sourcetype_name]
       ..
      BREAK_ONLY_BEFORE= (\<record\>)
      SHOULD_LINEMERGE = true

Unfortunately, it's not working for me.
Any ideas, please!

0 Karma

woodcock
Esteemed Legend

Don't use BREAK_ONLY_BEFORE, use this:

[YourSourcetypeNameHere]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n\s]+\<record\>[\r\n\s]+)
0 Karma

badrsplunk
New Member

Always not working!! no
search data indexed. It's like, when i try to size events, no data indexed.

0 Karma

woodcock
Esteemed Legend

These settings are correct, so it must be something else. If you are doing a sourcetype override/overwrite, you must use the ORIGINAL value, NOT the new value. You must deploy your settings to the first full instance(s) of Splunk that handle the events (usually either the HF tier if you use one, or else your Indexer tier) UNLESS you are using HEC's JSON endpoint (it gets pre-cooked) or INDEXED_EXTRACTIONS (configs go on the UF in that case), then restart all Splunk instances there. When (re)evaluating, you must send in new events (old events will stay broken), then test using _index_earliest=-5m to be absolutely certain that you are only examining the newly indexed events.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Your BREAK_ONLY_BEFORE value was eaten by the formatter. Please edit your question. To prevent the formatter from mangling the contents, indent each line of the props.conf file at least 4 spaces.

---
If this reply helps you, Karma would be appreciated.
0 Karma

codebuilder
Influencer

do you have kvmode=xml set?

----
An upvote would be appreciated and Accept Solution if it helps!
0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...