<?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 out event before indexing using REGEX in Security</title>
    <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388785#M13382</link>
    <description>&lt;P&gt;You would also need to ensure that the line with debug, "d" and the following line 1, 2 ... should be configured/treated as multi-line, so as to remove all of them together with nullQueue&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jan 2019 13:14:40 GMT</pubDate>
    <dc:creator>lakshman239</dc:creator>
    <dc:date>2019-01-08T13:14:40Z</dc:date>
    <item>
      <title>Filter out event before indexing using REGEX</title>
      <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388782#M13379</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I would like to filter out the log entries (before indexing) which are created in the debugging mode. They can be identified by the letter "d" in my logfile:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[293672]{-1}[-1/-1] 2019-01-08 11:24:29.210542 d PITRestart       LogReplayCoordinator.cpp(02658) : replayStepFinished(), logPos=0x1d2e2bab65b8
Line 1
Line 2
Line N
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the above there is a header line, which has always a similar structure and the 3 additional lines of the event. The header line includes always the pattern:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;11:24:29.210542 d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where the letter can be "i" for info, "e" for error, "d" for debug, etc.&lt;BR /&gt;
Now, I would like to filter out all the events (header line plus belonging lines) where the loglevel is "d".&lt;BR /&gt;
How would I achieve this?&lt;/P&gt;

&lt;P&gt;On the example of the below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[259451]{-1}[-1/-1] 2019-01-08 11:24:29.213984 a STATS_CTRL       Schedule.cpp(00106) : Enter void StatisticsService::ScheduleReloader::updateExecutionQueue(StatisticsService::ExecutionQueue&amp;amp;)
Arg this = 0x00007e382849b0a8
[293672]{-1}[-1/-1] 2019-01-08 11:24:29.210542 d PITRestart       LogReplayCoordinator.cpp(02658) : replayStepFinished(), logPos=0x1d2e2bab65b8
Line 1
Line 2
Line N
[265685]{242705}[1340/-1] 2019-01-08 11:24:29.144534 e StatementResourc StatementResourceTracking.cc(00217) : statistics collection is not finished: stmt=0x00007e8643473400, stmtid=1042411823155799
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to get rid of the second event and have only the following after indexing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[259451]{-1}[-1/-1] 2019-01-08 11:24:29.213984 a STATS_CTRL       Schedule.cpp(00106) : Enter void StatisticsService::ScheduleReloader::updateExecutionQueue(StatisticsService::ExecutionQueue&amp;amp;)
Arg this = 0x00007e382849b0a8
[265685]{242705}[1340/-1] 2019-01-08 11:24:29.144534 e StatementResourc StatementResourceTracking.cc(00217) : statistics collection is not finished: stmt=0x00007e8643473400, stmtid=1042411823155799
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could you help me with the props.conf, transforms.conf and especially the corresponding REGEX for that?&lt;/P&gt;

&lt;P&gt;Kind Regards,&lt;BR /&gt;
Kamil&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 12:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388782#M13379</guid>
      <dc:creator>damucka</dc:creator>
      <dc:date>2019-01-08T12:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out event before indexing using REGEX</title>
      <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388783#M13380</link>
      <description>&lt;P&gt;Hi @damucka,&lt;/P&gt;

&lt;P&gt;Please try below config on Indexer/Heavy Forwarder whichever comes first from Universal Forwarder.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
TRANSFORMS-eliminatedebug = setnull
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX=(?m)\d{4}\-\d{2}\-\d{2}\s\d{2}\:\d{2}\:\d{2}\.\d{6}\sd
DEST_KEY=queue
FORMAT=nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;EDIT: If &lt;CODE&gt;Line 1, Line 2 ... Line N&lt;/CODE&gt; are events with Debug line then you can try below transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX=(?s)\d{4}\-\d{2}\-\d{2}\s\d{2}\:\d{2}\:\d{2}\.\d{6}\sd.*\n
DEST_KEY=queue
FORMAT=nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Jan 2019 13:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388783#M13380</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-01-08T13:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out event before indexing using REGEX</title>
      <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388784#M13381</link>
      <description>&lt;P&gt;can we simply use "210542 d" &lt;BR /&gt;
&lt;CODE&gt;REGEX=210542\sd&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 13:11:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388784#M13381</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2019-01-08T13:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out event before indexing using REGEX</title>
      <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388785#M13382</link>
      <description>&lt;P&gt;You would also need to ensure that the line with debug, "d" and the following line 1, 2 ... should be configured/treated as multi-line, so as to remove all of them together with nullQueue&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 13:14:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388785#M13382</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-01-08T13:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out event before indexing using REGEX</title>
      <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388786#M13383</link>
      <description>&lt;P&gt;Hi @inventsekar,&lt;/P&gt;

&lt;P&gt;I guess datetime value which is provided is for sample only so &lt;CODE&gt;210542\sd&lt;/CODE&gt; will not work because it is subsecond and every event will have different values for subsecond.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 13:15:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388786#M13383</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-01-08T13:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out event before indexing using REGEX</title>
      <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388787#M13384</link>
      <description>&lt;P&gt;I am guessing that 1,2 ... those are same type of events and not multiline values.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 13:16:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388787#M13384</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-01-08T13:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out event before indexing using REGEX</title>
      <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388788#M13385</link>
      <description>&lt;P&gt;At the moment we have 3 events there, each starting with the header line. Not sure about the multiline values ... I did nothing with the configuration, Splunk recognizes it itself. So, to make it clear - I would like to get rid of the second event.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 13:30:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388788#M13385</guid>
      <dc:creator>damucka</dc:creator>
      <dc:date>2019-01-08T13:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out event before indexing using REGEX</title>
      <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388789#M13386</link>
      <description>&lt;P&gt;I have provided 2 different regex for transforms.conf, you can try that and let us know if it will not work.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 13:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388789#M13386</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-01-08T13:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out event before indexing using REGEX</title>
      <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388790#M13387</link>
      <description>&lt;P&gt;Thank you. I will test and let you know.&lt;BR /&gt;
Is it possible to match several sourcetypes in props.conf to the same entry in transforms.conf? Like below:&lt;/P&gt;

&lt;P&gt;[yoursourcetype1]&lt;BR /&gt;
 TRANSFORMS-eliminatedebug = setnull&lt;/P&gt;

&lt;P&gt;[yoursourcetype2]&lt;BR /&gt;
 TRANSFORMS-eliminatedebug = setnull&lt;/P&gt;

&lt;P&gt;[yoursourcetype3]&lt;BR /&gt;
 TRANSFORMS-eliminatedebug = setnull&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 13:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388790#M13387</guid>
      <dc:creator>damucka</dc:creator>
      <dc:date>2019-01-08T13:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out event before indexing using REGEX</title>
      <link>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388791#M13388</link>
      <description>&lt;P&gt;Yes you can&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 14:06:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Filter-out-event-before-indexing-using-REGEX/m-p/388791#M13388</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-01-08T14:06:21Z</dc:date>
    </item>
  </channel>
</rss>

