<?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: Filter data and Extract field before indexed in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303613#M57325</link>
    <description>&lt;P&gt;Use this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source:://C:\\myfoler\\mylogfile.log] 
SEDCMD-trim_raw = s%\(\w+\)\s+\|\s+jvm\s+1\s+\|\s+\(\d+\/\d+\/\d+\)\s+\(\d+\:\d+\:\d+\)\s+\|\s+\(.*\)-\s+\(.*\)%\1 \2 \3 \4 \5%
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 May 2017 01:56:33 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-05-26T01:56:33Z</dc:date>
    <item>
      <title>Filter data and Extract field before indexed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303610#M57322</link>
      <description>&lt;P&gt;To avoid over index usage, I want to filter before it indexed and I also want extract field before indexed as well.&lt;BR /&gt;
As of now, I am trying to configure extract field, so later based on field values I can filter data.&lt;/P&gt;

&lt;P&gt;Following is my configuration, I don't why  props.conf and transforms.conf isn't working. &lt;/P&gt;

&lt;P&gt;Configuration on Splunk Universal Forward is as follow:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor://C:\myfoler\mylogfile.log]
disabled = false 
index = test_index
sourcetype = Logfile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk Indexer configuration is as follow:&lt;/P&gt;

&lt;P&gt;cat $SPLUNK_HOME/etc/system/local/props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source:://C:\\myfoler\\mylogfile.log]
TRANSFORMS-MyLOG = MyLOG
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cat $SPLUNK_HOME/etc/system/local/transforms.conf &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MyLOG] 
DEST_KEY = _raw 
REGEX = (?&amp;lt;MyType&amp;gt;\w+)\s+\|\s+jvm\s+1\s+\|\s+(?&amp;lt;Date&amp;gt;\d+\/\d+\/\d+)\s+(?&amp;lt;Time&amp;gt;\d+\:\d+\:\d+)\s+\|\s+(?&amp;lt;EventTimeStamp&amp;gt;.*)-\s+(?&amp;lt;Message&amp;gt;.*)
FORMAT = $1 $2 $3 $4 $5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regex is working perfectly fine when I use this in splunk search.&lt;/P&gt;

&lt;P&gt;Please also guide, how I can filter data, for example&lt;BR /&gt;
if fieldx == Value1  // Index this data&lt;BR /&gt;
if fieldx == Value2 // Drop this data&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 11:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303610#M57322</guid>
      <dc:creator>gurveer_singh88</dc:creator>
      <dc:date>2017-05-19T11:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data and Extract field before indexed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303611#M57323</link>
      <description>&lt;P&gt;I think your main problem is that you are trying to do this on the UF. It needs to be done using a heavy forwarder or on the indexer.&lt;/P&gt;

&lt;P&gt;For filtering take a look at &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.6.0/Forwarding/Routeandfilterdatad"&gt;Filter event data and send to queues&lt;/A&gt; in the documentation &lt;/P&gt;

&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 13:38:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303611#M57323</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2017-05-19T13:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data and Extract field before indexed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303612#M57324</link>
      <description>&lt;P&gt;Thanks for your response.&lt;/P&gt;

&lt;P&gt;Using UF, I am just forwarding logs. &lt;BR /&gt;
props.conf and transforms.conf are placed on indexer (Splunk Enterprise).&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 04:21:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303612#M57324</guid>
      <dc:creator>gurveer_singh88</dc:creator>
      <dc:date>2017-05-22T04:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data and Extract field before indexed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303613#M57325</link>
      <description>&lt;P&gt;Use this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source:://C:\\myfoler\\mylogfile.log] 
SEDCMD-trim_raw = s%\(\w+\)\s+\|\s+jvm\s+1\s+\|\s+\(\d+\/\d+\/\d+\)\s+\(\d+\:\d+\:\d+\)\s+\|\s+\(.*\)-\s+\(.*\)%\1 \2 \3 \4 \5%
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 May 2017 01:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303613#M57325</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-26T01:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data and Extract field before indexed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303614#M57326</link>
      <description>&lt;P&gt;I used following configuration but I was getting error when i restart Splunk Enterprise.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cat etc/system/local/transforms.conf
[MyLOG]
DEST_KEY = _raw
SEDCMD-trim_raw = s%\(\w+\)\s+\|\s+jvm\s+1\s+\|\s+\(\d+\/\d+\/\d+\)\s+\(\d+\:\d+\:\d+\)\s+\|\s+\(.*\)-\s+\(.*\)%\1 \2 \3 \4 \5%
FORMAT = $MyType $Data $Time $EventTimeStamp $Message

Error is as following:
Invalid key in stanza [fMyLOG] in $SPLUNK_HOME/etc/system/local/transforms.conf, line 3: SEDCMD-trim_raw  (value:  s%\(\w+\)\s+\|\s+jvm\s+1\s+\|\s+\(\d+\/\d+\/\d+\)\s+\(\d+\:\d+\:\d+\)\s+\|\s+\(.*\)-\s+\(.*\)%\1 \2 \3 \4 \5%).
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Am I doing something wrong here?&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 06:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303614#M57326</guid>
      <dc:creator>gurveer_singh88</dc:creator>
      <dc:date>2017-05-26T06:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data and Extract field before indexed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303615#M57327</link>
      <description>&lt;P&gt;Yes, you do not need the &lt;CODE&gt;DEST_KEY&lt;/CODE&gt;, nor the &lt;CODE&gt;FORMAT&lt;/CODE&gt;; you only need the single &lt;CODE&gt;SEDCMD&lt;/CODE&gt; line under the stanza header and it needs to be in &lt;CODE&gt;props.conf&lt;/CODE&gt;, not &lt;CODE&gt;transforms.conf&lt;/CODE&gt;.  It needs to be deployed to your Indexers and all Splunk instances restarted there.  This will only effect events which are indexed AFTER the restarts.&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 14:24:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-data-and-Extract-field-before-indexed/m-p/303615#M57327</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-27T14:24:29Z</dc:date>
    </item>
  </channel>
</rss>

