<?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: Data is not getting filtered with my set regex in transforms.conf? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280502#M84648</link>
    <description>&lt;P&gt;I suspect that the source is not matching the source specified in your &lt;CODE&gt;props.conf&lt;/CODE&gt; - remember that the source is case sensitive.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/opt/apps/splunk/data/test/*]
TRANSFORMS-set=setnull,setparsing
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, if it &lt;EM&gt;was&lt;/EM&gt; working, you would have another problem. The &lt;CODE&gt;setnull&lt;/CODE&gt; transform will send &lt;EM&gt;all&lt;/EM&gt; the events to the &lt;CODE&gt;nullQueue&lt;/CODE&gt;, thereby deleting them. Why? Because the REGEX (&lt;CODE&gt;.&lt;/CODE&gt;) matches &lt;EM&gt;every&lt;/EM&gt; event - and you have specified that this transform is applied first. Second, the REGEX is applied to each &lt;EM&gt;event&lt;/EM&gt; individually, while &lt;A href="http://regex101.com/"&gt;http://regex101.com/&lt;/A&gt; is looking at the text as a whole.&lt;/P&gt;

&lt;P&gt;I think this will work better, assuming that you get the &lt;CODE&gt;source&lt;/CODE&gt; correct:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/opt/apps/splunk/data/test/*]
SHOULD_LINEMERGE=false
TRANSFORMS-set= setparsing,setnull
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = ^\s*\d{3}\s+\d{4}
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Oct 2015 05:51:11 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2015-10-16T05:51:11Z</dc:date>
    <item>
      <title>Data is not getting filtered with my set regex in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280499#M84645</link>
      <description>&lt;P&gt;I have following set up in props.conf and transforms.conf.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/opt/apps/splunk/data/test/*]
TRANSFORMS-set= setnull,setparsing
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = (?:Mkt.*\n)(?s)(.*?)(?:[A-Z])
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am ingesting a data file containing following data through a universal forawrder, and I made the above change in &lt;CODE&gt;/splunk/etc/system/local&lt;/CODE&gt;: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Sample ABC Report   
                Date:2009-12-01     
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FileName: xxx.txt
-------------------------------------------------------------------
File Processing Start Time:20091201 07:12:14

This file contains the following payments:                                      
Mkt  Bk    Sender Id    Cntry  Curr         Total Value          Total Records
001  0871  1234          124    124             1140843                  7
001  0700  2341          124    124              399559                  2
001  9875  4567          124    124            7373838                  76
001  0700  6789          124    124              761825                  5
ABC.EM.0072.0005
ABC.TM.0072.0006
CDE.EM.0098.0007

File Processing End Time:20091201 07:12:14
-------------------------------------------------------------------
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And my objective is to  select only following data from above&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;001  0871  1234          124    124             1140843                  7
001  0700  2341          124    124              399559                  2
001  9875  4567          124    124            13842408                  76
001  0700  6789          124    124              761825                  5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I checked with &lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt; and my regular expression is extracting the same.&lt;/P&gt;

&lt;P&gt;Please advise what could be possible reason that I am getting all data without filtering it. I restarted the indexer after the change.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 01:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280499#M84645</guid>
      <dc:creator>sandipan11</dc:creator>
      <dc:date>2015-10-15T01:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Data is not getting filtered with my set regex in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280500#M84646</link>
      <description>&lt;P&gt;The props/transforms are placed on Indexers, correct?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 04:32:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280500#M84646</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-15T04:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Data is not getting filtered with my set regex in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280501#M84647</link>
      <description>&lt;P&gt;yes I kept in indexer&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 05:24:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280501#M84647</guid>
      <dc:creator>sandipan11</dc:creator>
      <dc:date>2015-10-16T05:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Data is not getting filtered with my set regex in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280502#M84648</link>
      <description>&lt;P&gt;I suspect that the source is not matching the source specified in your &lt;CODE&gt;props.conf&lt;/CODE&gt; - remember that the source is case sensitive.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/opt/apps/splunk/data/test/*]
TRANSFORMS-set=setnull,setparsing
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, if it &lt;EM&gt;was&lt;/EM&gt; working, you would have another problem. The &lt;CODE&gt;setnull&lt;/CODE&gt; transform will send &lt;EM&gt;all&lt;/EM&gt; the events to the &lt;CODE&gt;nullQueue&lt;/CODE&gt;, thereby deleting them. Why? Because the REGEX (&lt;CODE&gt;.&lt;/CODE&gt;) matches &lt;EM&gt;every&lt;/EM&gt; event - and you have specified that this transform is applied first. Second, the REGEX is applied to each &lt;EM&gt;event&lt;/EM&gt; individually, while &lt;A href="http://regex101.com/"&gt;http://regex101.com/&lt;/A&gt; is looking at the text as a whole.&lt;/P&gt;

&lt;P&gt;I think this will work better, assuming that you get the &lt;CODE&gt;source&lt;/CODE&gt; correct:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/opt/apps/splunk/data/test/*]
SHOULD_LINEMERGE=false
TRANSFORMS-set= setparsing,setnull
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = ^\s*\d{3}\s+\d{4}
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Oct 2015 05:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280502#M84648</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-10-16T05:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Data is not getting filtered with my set regex in transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280503#M84649</link>
      <description>&lt;P&gt;Location is Correct.  When I was using my configuration no filtering was happening but now with you set up no data is coming I mean data is not ingesting at all..... as data is not coming so it confirms that source is matching rest condition blocking the data.&lt;/P&gt;

&lt;P&gt;Please advise. &lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 19:35:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Data-is-not-getting-filtered-with-my-set-regex-in-transforms/m-p/280503#M84649</guid>
      <dc:creator>sandipan11</dc:creator>
      <dc:date>2015-10-16T19:35:27Z</dc:date>
    </item>
  </channel>
</rss>

