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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...