<?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: Filtering the log using REGEX in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-the-log-using-REGEX/m-p/102548#M21508</link>
    <description>&lt;P&gt;The transform doesn't have to be called "setnull", it's just what's used in the examples. You can call the transform anything, the only thing that matters is that it has &lt;EM&gt;any&lt;/EM&gt; name so that there is something to refer to it by in props.conf.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Nov 2011 19:46:12 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2011-11-02T19:46:12Z</dc:date>
    <item>
      <title>Filtering the log using REGEX</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-the-log-using-REGEX/m-p/102545#M21505</link>
      <description>&lt;P&gt;I have following log. What will be the REGEX to index log containing line the line 'tomcat' trying to restart and send rest to nullQueue??&lt;/P&gt;

&lt;P&gt;[CDT Oct 27 09:31:44] info     : 'tomcat' trying to restart&lt;BR /&gt;
[CDT Oct 27 09:31:44] info     : 'tomcat' start: /sbin/service&lt;BR /&gt;
[CDT Oct 27 09:33:44] info     : 'tomcat' process is running with pid 20021&lt;BR /&gt;
[CDT Oct 27 12:13:44] error    : 'tomcat' process PID changed to 6908&lt;BR /&gt;
[CDT Oct 27 12:15:44] info     : 'tomcat' PID has not changed&lt;BR /&gt;
[CDT Oct 27 14:30:04] info     : unmonitor service 'tomcat' on user request&lt;BR /&gt;
[CDT Oct 27 14:30:04] info     : monit daemon at 13351 awakened&lt;BR /&gt;
[CDT Oct 27 14:30:04] info     : Awakened by User defined signal 1&lt;BR /&gt;
[CDT Oct 27 14:30:15] info     : restart service 'tomcat' on user request&lt;BR /&gt;
[CDT Oct 27 14:30:15] info     : monit daemon at 13351 awakened&lt;BR /&gt;
[CDT Oct 27 14:30:15] info     : Awakened by User defined signal 1&lt;BR /&gt;
[CDT Oct 27 14:30:15] info     : 'tomcat' trying to restart&lt;BR /&gt;
[CDT Oct 27 14:30:15] info     : 'tomcat' stop: /sbin/service&lt;BR /&gt;
[CDT Oct 27 14:30:43] info     : 'tomcat' start: /sbin/service&lt;BR /&gt;
[CDT Oct 27 14:31:43] error    : 'tomcat' failed to start&lt;BR /&gt;
[CDT Oct 27 14:32:43] error    : 'tomcat' process is not running&lt;BR /&gt;
[CDT Oct 27 14:32:43] info     : 'tomcat' trying to restart&lt;BR /&gt;
[CDT Oct 27 14:32:43] info     : 'tomcat' start: /sbin/service&lt;BR /&gt;
[CDT Oct 27 14:32:44] info     : 'tomcat' started&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2011 15:34:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-the-log-using-REGEX/m-p/102545#M21505</guid>
      <dc:creator>keshab</dc:creator>
      <dc:date>2011-11-02T15:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering the log using REGEX</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-the-log-using-REGEX/m-p/102546#M21506</link>
      <description>&lt;P&gt;First define a nullqueue transform, then another one to override it in the specific case where the event contains "'tomcat' trying to restart". Have a look at this topic in the docs: &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.1.5/Admin/Routeandfilterdata#Keep_specific_events_and_discard_the_rest"&gt;http://docs.splunk.com/Documentation/Splunk/4.1.5/Admin/Routeandfilterdata#Keep_specific_events_and_discard_the_rest&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This should work:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;props.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
TRANSFORMS-set= defaultnull,tomcatrestart
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;transforms.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[defaultnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[tomcatrestart]
REGEX = 'tomcat' trying to restart
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2011 15:41:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-the-log-using-REGEX/m-p/102546#M21506</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-11-02T15:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering the log using REGEX</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-the-log-using-REGEX/m-p/102547#M21507</link>
      <description>&lt;P&gt;According to the docs if you want data to be sent to the null queue than you have to call your stanza in the transforms.conf setnull, ie:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
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 = \'tomcat\' trying to restart
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2011 19:04:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-the-log-using-REGEX/m-p/102547#M21507</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2011-11-02T19:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering the log using REGEX</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-the-log-using-REGEX/m-p/102548#M21508</link>
      <description>&lt;P&gt;The transform doesn't have to be called "setnull", it's just what's used in the examples. You can call the transform anything, the only thing that matters is that it has &lt;EM&gt;any&lt;/EM&gt; name so that there is something to refer to it by in props.conf.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2011 19:46:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-the-log-using-REGEX/m-p/102548#M21508</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-11-02T19:46:12Z</dc:date>
    </item>
  </channel>
</rss>

