<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pre-index filtering - filter non-xml lines from xml data in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Pre-index-filtering-filter-non-xml-lines-from-xml-data/m-p/198005#M39282</link>
    <description>&lt;P&gt;Hi ajaysamantbms,&lt;/P&gt;

&lt;P&gt;the problem with this kind of question is always the same: &lt;/P&gt;

&lt;P&gt;if this will work in your setup with your data must be tested by yourself and therefore only you will be able to answer if this will work for you or not.&lt;/P&gt;

&lt;P&gt;the conf files look ok and the regex matches your XML data. So go ahead and test it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Mon, 24 Mar 2014 09:27:36 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-03-24T09:27:36Z</dc:date>
    <item>
      <title>Pre-index filtering - filter non-xml lines from xml data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Pre-index-filtering-filter-non-xml-lines-from-xml-data/m-p/198004#M39281</link>
      <description>&lt;P&gt;My event data contains the foll&lt;/P&gt;

&lt;P&gt;POST:....&lt;BR /&gt;
...&lt;BR /&gt;
&lt;TRANSACTION&gt;ffffff&lt;/TRANSACTION&gt;&lt;BR /&gt;
ABCD&lt;BR /&gt;
EFG&lt;BR /&gt;
&lt;ACCESS&gt;&lt;/ACCESS&gt;&lt;BR /&gt;
WERT&lt;BR /&gt;
SDF&lt;BR /&gt;
... and so on&lt;/P&gt;

&lt;P&gt;As you see some lines are non-xml and some are xml..&lt;/P&gt;

&lt;P&gt;my props.conf file has foll set of rules&lt;/P&gt;

&lt;P&gt;[sourcetype]&lt;BR /&gt;
BREAK_ONLY_BEFORE = &lt;TRANSACTION&gt;|&lt;ACCESS&gt;|&lt;ERROR&gt;&lt;BR /&gt;
KV_MODE = xml&lt;BR /&gt;
NO_BINARY_CHECK = 1&lt;BR /&gt;
SHOULD_LINEMERGE = true&lt;BR /&gt;
pulldown_type = 1&lt;BR /&gt;
TRANSFORMS-set = setnull, setparsing&lt;/ERROR&gt;&lt;/ACCESS&gt;&lt;/TRANSACTION&gt;&lt;/P&gt;

&lt;P&gt;and in transforms.xml&lt;/P&gt;

&lt;P&gt;[setnull]&lt;BR /&gt;
REGEX= .&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;

&lt;P&gt;[setparsing]&lt;BR /&gt;
REGEX = &lt;TRANSACTION&gt;|&lt;ERROR&gt;|&lt;ACCESS&gt;&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = indexQueue&lt;/ACCESS&gt;&lt;/ERROR&gt;&lt;/TRANSACTION&gt;&lt;/P&gt;

&lt;P&gt;Will this work? ...the lines outside XML tags as shown in example should not be indexed..&lt;BR /&gt;
And should i do this in heavy forwarders or at universal lightweight forwarders&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:12:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Pre-index-filtering-filter-non-xml-lines-from-xml-data/m-p/198004#M39281</guid>
      <dc:creator>ajaysamantbms</dc:creator>
      <dc:date>2020-09-28T16:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pre-index filtering - filter non-xml lines from xml data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Pre-index-filtering-filter-non-xml-lines-from-xml-data/m-p/198005#M39282</link>
      <description>&lt;P&gt;Hi ajaysamantbms,&lt;/P&gt;

&lt;P&gt;the problem with this kind of question is always the same: &lt;/P&gt;

&lt;P&gt;if this will work in your setup with your data must be tested by yourself and therefore only you will be able to answer if this will work for you or not.&lt;/P&gt;

&lt;P&gt;the conf files look ok and the regex matches your XML data. So go ahead and test it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 09:27:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Pre-index-filtering-filter-non-xml-lines-from-xml-data/m-p/198005#M39282</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-24T09:27:36Z</dc:date>
    </item>
  </channel>
</rss>

