<?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 Events per EventID in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170146#M34368</link>
    <description>&lt;P&gt;For Windows events pulled with a WinEventLog:xxxx stanza in your inputs.conf, you can use native filtering as described &lt;A href="http://blogs.splunk.com/2013/10/14/windows-event-logs-in-splunk-6/"&gt;here&lt;/A&gt;&lt;BR /&gt;
Detailed documentation is available &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/Data/Monitorwindowsdata#Create_advanced_filters_with_.27whitelist.27_and_.27blacklist.27"&gt;here&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you specify "blacklist" underneath a [monitor:] stanza, the RegEx will be applied to the , not the events in the log file.&lt;BR /&gt;
Please read up &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/Forwarding/Routeandfilterdatad#Filter_event_data_and_send_to_queues"&gt;here&lt;/A&gt; on how to use props/transforms to filter events from non-Windows eventlog sources. &lt;/P&gt;</description>
    <pubDate>Thu, 13 Aug 2015 20:33:21 GMT</pubDate>
    <dc:creator>s2_splunk</dc:creator>
    <dc:date>2015-08-13T20:33:21Z</dc:date>
    <item>
      <title>Filter Events per EventID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170145#M34367</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;

&lt;P&gt;I am relatively new to splunk so I just have an basic  knowledge and I apologize if my question is answered else where due a lack of knowledge (even tough I  looked quite a while for a solution ).&lt;/P&gt;

&lt;P&gt;Most solutions are for older Splunk versions and did not work.&lt;/P&gt;

&lt;P&gt;What I want to do:&lt;/P&gt;

&lt;P&gt;I want to filter specific events by an EventID (like Windows event log but I also have different logs so I would appreciate a solution where I only have to change the sourcetype and IDs.&lt;/P&gt;

&lt;P&gt;From other Questions I have the following:&lt;/P&gt;

&lt;P&gt;index.conf:&lt;/P&gt;

&lt;P&gt;[monitor://&amp;lt;path&amp;gt;\20150809]&lt;BR /&gt;
sourcetype = CDE0&lt;BR /&gt;
blacklist = 5156&lt;BR /&gt;
disabled = 0&lt;/P&gt;

&lt;P&gt;that blacklist was my first try but I think I can only black list files and folders in there.&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;P&gt;[CDE0]&lt;BR /&gt;
TRANSFORMS-t1=eliminate-eventcodes&lt;/P&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;P&gt;[eliminate-eventcodes]&lt;BR /&gt;
REGEX=EventID=(5156)&lt;BR /&gt;
DEST_KEY=queue&lt;BR /&gt;
FORMAT=nullQueue&lt;/P&gt;

&lt;P&gt;I think my problem is in the transforms.conf but I am not really sure.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;EDIT: It might be obvious but the filtering should happen before indexing&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2015 10:05:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170145#M34367</guid>
      <dc:creator>mlb19</dc:creator>
      <dc:date>2015-08-13T10:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Events per EventID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170146#M34368</link>
      <description>&lt;P&gt;For Windows events pulled with a WinEventLog:xxxx stanza in your inputs.conf, you can use native filtering as described &lt;A href="http://blogs.splunk.com/2013/10/14/windows-event-logs-in-splunk-6/"&gt;here&lt;/A&gt;&lt;BR /&gt;
Detailed documentation is available &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/Data/Monitorwindowsdata#Create_advanced_filters_with_.27whitelist.27_and_.27blacklist.27"&gt;here&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you specify "blacklist" underneath a [monitor:] stanza, the RegEx will be applied to the , not the events in the log file.&lt;BR /&gt;
Please read up &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/Forwarding/Routeandfilterdatad#Filter_event_data_and_send_to_queues"&gt;here&lt;/A&gt; on how to use props/transforms to filter events from non-Windows eventlog sources. &lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2015 20:33:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170146#M34368</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2015-08-13T20:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Events per EventID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170147#M34369</link>
      <description>&lt;P&gt;Hi mlb19, &lt;/P&gt;

&lt;P&gt;additionally to the documentation ssievert posted a sample event of the data you &lt;EM&gt;don't&lt;/EM&gt; want to index would be helpful. &lt;/P&gt;

&lt;P&gt;You are right with your inputs.conf (i assume thats a typo). The blacklisting/whitelisting works on files or some inputs like the windows events ssievert mentioned. Otherwise your props.conf and transforms.conf dont seem to be absolutely off. &lt;/P&gt;

&lt;P&gt;The guess is, thats your REGEX=EventID=(5156) is just not matching your events.&lt;/P&gt;

&lt;P&gt;Greetings&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2015 07:01:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170147#M34369</guid>
      <dc:creator>hgrow</dc:creator>
      <dc:date>2015-08-14T07:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Events per EventID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170148#M34370</link>
      <description>&lt;P&gt;Okay, thank you. I will try that.&lt;BR /&gt;
I guess you meant files or folders when you said "RegEx will be applied to the ," sice that is what I found while I was browsing through the documentation.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2015 08:27:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170148#M34370</guid>
      <dc:creator>mlb19</dc:creator>
      <dc:date>2015-08-14T08:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Events per EventID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170149#M34371</link>
      <description>&lt;P&gt;Hi hgrow,&lt;/P&gt;

&lt;P&gt;yes that was just a typo &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I will edit it now.&lt;/P&gt;

&lt;P&gt;Here are some examples of Events I want to filter:&lt;/P&gt;

&lt;P&gt;Some of them have an LogCode or an specific ID:&lt;/P&gt;

&lt;P&gt;14:32:59.645 | LogCode:046 | AppName:            | ProcessID:16778070(854) | Msg: ERR. File - Read Line - Unexpected end of file. &lt;/P&gt;

&lt;P&gt;But some others only have text:&lt;/P&gt;

&lt;P&gt;INFO     [2015/07/15 00:07:29.681]  C1| Using primary system database, via direct ODBC.&lt;/P&gt;

&lt;P&gt;For the post I want to filter that event:&lt;/P&gt;

&lt;P&gt;8/8/2015    23:46:27    8   5156    Microsoft-Windows-Security-Auditing The Windows Filtering Platform has allowed a connection.    Application Information:&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;--&lt;BR /&gt;
I can't edit my original post because I exceeded my limit of 2 posts per day...&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2015 08:37:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170149#M34371</guid>
      <dc:creator>mlb19</dc:creator>
      <dc:date>2015-08-14T08:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Events per EventID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170150#M34372</link>
      <description>&lt;P&gt;Hi mlb19,&lt;/P&gt;

&lt;P&gt;it's your REGEX thats not match your Event you want to filter. Despite the filtering of windows event what generally happens is, that the REGEX is just looking for a String in your event, that is matching the regex.&lt;/P&gt;

&lt;P&gt;If you are working with regex &lt;A href="https://regex101.com"&gt;https://regex101.com&lt;/A&gt; is always a great tool. Just insert your events into the test string field and try your regex.&lt;/P&gt;

&lt;P&gt;For your specific events &lt;CODE&gt; 5156&lt;/CODE&gt; is the simplest Regex that would match the event. But every other event that might contain the  numerical sequence 5156 is also filtered. A more precise one could be something like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\d*\/\d*\/\d*\s\d*\:\d*\:\d*\s\d*\s5156
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;EDIT: less accurate but more optimized regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(\d+.){6}\d+\s5156
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it helps&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2015 09:20:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170150#M34372</guid>
      <dc:creator>hgrow</dc:creator>
      <dc:date>2015-08-14T09:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Events per EventID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170151#M34373</link>
      <description>&lt;P&gt;Hi hgrow,&lt;/P&gt;

&lt;P&gt;I tried all of your regex but none of them works.&lt;BR /&gt;
This is how my .config files look like in \etc\system\local:&lt;/P&gt;

&lt;P&gt;inputs.conf:&lt;BR /&gt;
[monitor://\Eventvwr1599sec.txt]&lt;BR /&gt;
sourcetype = cde0&lt;BR /&gt;&lt;BR /&gt;
crcSalt = \Eventvwr1599sec.txt&lt;BR /&gt;
disabled = 0&lt;/P&gt;

&lt;P&gt;props.conf:&lt;BR /&gt;
[source::&amp;gt;\Eventvwr1599sec.txt]&lt;/P&gt;

&lt;P&gt;transforms.conf:&lt;BR /&gt;
[filter5156]&lt;BR /&gt;
REGEX = (\d+.){6}\d+\s5156&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;BR /&gt;
TRANSFORMS-cde0 = filter5156&lt;/P&gt;

&lt;P&gt;I guess I did a very stupid mistake somewhere...&lt;BR /&gt;
If I look trough my indexed events sourcetype=cde0 5156 works fine.&lt;/P&gt;

&lt;P&gt;Any idea what I am doing wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2015 16:13:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170151#M34373</guid>
      <dc:creator>mlb19</dc:creator>
      <dc:date>2015-08-18T16:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Events per EventID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170152#M34374</link>
      <description>&lt;P&gt;Hi mlb19&lt;BR /&gt;
You left something out what've already done right in your initial configuration. In your propfs.conf you forgot the TRANSFORMS- attribute to determine the routing. The next this is &lt;CODE&gt;[source::&amp;gt;Eventvwr1599sec.txt]&lt;/CODE&gt; looks a bit off. I'm not sure if thats a typo or not but the generall form is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;spec&amp;gt;]
TRANSFORMS-routing=&amp;lt;transforms_stanza_name&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where  can be: &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt; &lt;EM&gt;sourcetype&lt;/EM&gt;, the source type of an event&lt;/LI&gt;
&lt;LI&gt;host::&lt;EM&gt;host&lt;/EM&gt;, where  is the host for an event&lt;/LI&gt;
&lt;LI&gt; source::&lt;EM&gt;source&lt;/EM&gt;, where &lt;EM&gt;source&lt;/EM&gt; is the source for an event&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Source: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/Forwarding/Routeandfilterdatad#Configure_routing"&gt;Configure routing&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;To make it easy i would go with the sourcetype here: &lt;BR /&gt;
propfs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[cde0]
TRANSFORMS-filterrouting=filter5156
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Other than that it looks good to me. The REGEX is not quite correct, but i assume Splunk-Answers is not showing the escape Symbols &lt;CODE&gt;\&lt;/CODE&gt; correctly. It should be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (\d+.){6}\d+\s5156
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Greetings&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2015 18:50:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170152#M34374</guid>
      <dc:creator>hgrow</dc:creator>
      <dc:date>2015-08-18T18:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Events per EventID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170153#M34375</link>
      <description>&lt;P&gt;Oh yeah! It finally works! Thank you very much hgrow!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2015 08:43:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170153#M34375</guid>
      <dc:creator>mlb19</dc:creator>
      <dc:date>2015-08-19T08:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Events per EventID</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170154#M34376</link>
      <description>&lt;P&gt;Hi mlb19, &lt;/P&gt;

&lt;P&gt;it's nice to hear &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Good luck with your future splunking !&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2015 22:39:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-Events-per-EventID/m-p/170154#M34376</guid>
      <dc:creator>hgrow</dc:creator>
      <dc:date>2015-08-19T22:39:20Z</dc:date>
    </item>
  </channel>
</rss>

