<?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: Can you help me get blacklist WinEventLog Security to work? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-get-blacklist-WinEventLog-Security-to-work/m-p/434597#M75873</link>
    <description>&lt;P&gt;Hello @dkeck,&lt;/P&gt;

&lt;P&gt;I assume not all lines are shown in your example event. That is, the last line is not "Account Name: ..."&lt;/P&gt;

&lt;P&gt;So I believe you need to enable multi line mode. That way, $ will match the end of the line instead of the whole text.&lt;/P&gt;

&lt;P&gt;When you open &lt;A href="https://regex101.com/"&gt;regex101.com&lt;/A&gt;, you can see that multi line mode is enabled by default on regex101. When it comes to Splunk, you need to prefix the regex with (?m).&lt;/P&gt;

&lt;P&gt;So I suggest you try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;blacklist1 = EventCode="4627" Message="(?m)Account Name:\s+\w+\$$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 28 Jan 2019 14:11:18 GMT</pubDate>
    <dc:creator>whrg</dc:creator>
    <dc:date>2019-01-28T14:11:18Z</dc:date>
    <item>
      <title>Can you help me get blacklist WinEventLog Security to work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-get-blacklist-WinEventLog-Security-to-work/m-p/434596#M75872</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I tried to blacklist Windows event logs for EventCode and Message field content.&lt;/P&gt;

&lt;P&gt;I can't figure out what's going wrong here.&lt;/P&gt;

&lt;P&gt;My input, that was deployed to my universal forwarders ( I can see in internal that this happened for sure). App has "Restart Splunkd" and " Enable App" marked. Also checked with btool that the clients are picking up the conf changes.&lt;/P&gt;

&lt;P&gt;[WinEventLog://Security]&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;blacklist1= EventCode="4627" Message="Account\sName:\s+\w+\$$"
blacklist2= EventCode="4661" Message="Account\sName:\s+\w+\$$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to filter out EventCode 4627 and 4661 IF Account Name contains Names ending with $. Thats why I have $ twice. One for actually $ and one for end of line.&lt;/P&gt;

&lt;P&gt;I am using Message as a key field, since in inputs.conf, it's stated that WinEventLogs needs certain key fields, within you can then extract your value.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;The following keys are equivalent to&lt;BR /&gt;
the fields that appear in the text of &lt;BR /&gt;
the acquired events:   * Category,&lt;BR /&gt;
CategoryString, ComputerName,&lt;BR /&gt;
EventCode, EventType, Keywords,&lt;BR /&gt;
 LogName, Message, OpCode, RecordNumber, Sid, SidType,&lt;BR /&gt;
SourceName,TaskCategory, Type, User"&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Regex101 is extracting properly.&lt;/P&gt;

&lt;P&gt;I had a look in the _internal for blacklist1 and blacklist2 and for stanza WinEventLog://Security. No Error or Warm messages from clients.&lt;/P&gt;

&lt;P&gt;I use this search &lt;CODE&gt;index=myindex (EventCode="4661" OR EventCode="4627") Account_Name="*$"&lt;/CODE&gt; to test if there are still events coming. For now they are.&lt;/P&gt;

&lt;P&gt;So If anyone has a good hint on how to do this, please let me know. I would appreciate specific answers (why your code should work not only the code itself). Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Example Event for 4661&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EventCode=4661

EventType=0

Type=Information

ComputerName=xxx

TaskCategory=SAM

OpCode=Info

RecordNumber=xxx

Keywords=Audit Success

Message=A handle to an object was requested.Subject :

    Security ID:        xxxx

    Account Name:        XXXXXX$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Jan 2019 12:11:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-get-blacklist-WinEventLog-Security-to-work/m-p/434596#M75872</guid>
      <dc:creator>dkeck</dc:creator>
      <dc:date>2019-01-28T12:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me get blacklist WinEventLog Security to work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-get-blacklist-WinEventLog-Security-to-work/m-p/434597#M75873</link>
      <description>&lt;P&gt;Hello @dkeck,&lt;/P&gt;

&lt;P&gt;I assume not all lines are shown in your example event. That is, the last line is not "Account Name: ..."&lt;/P&gt;

&lt;P&gt;So I believe you need to enable multi line mode. That way, $ will match the end of the line instead of the whole text.&lt;/P&gt;

&lt;P&gt;When you open &lt;A href="https://regex101.com/"&gt;regex101.com&lt;/A&gt;, you can see that multi line mode is enabled by default on regex101. When it comes to Splunk, you need to prefix the regex with (?m).&lt;/P&gt;

&lt;P&gt;So I suggest you try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;blacklist1 = EventCode="4627" Message="(?m)Account Name:\s+\w+\$$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Jan 2019 14:11:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-get-blacklist-WinEventLog-Security-to-work/m-p/434597#M75873</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2019-01-28T14:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me get blacklist WinEventLog Security to work?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-get-blacklist-WinEventLog-Security-to-work/m-p/434598#M75874</link>
      <description>&lt;P&gt;Thank you for your response. I will try that.&lt;/P&gt;

&lt;P&gt;No its not the whole event, since win eventlog is pretty long.&lt;/P&gt;

&lt;P&gt;But it continues like this:&lt;/P&gt;

&lt;P&gt;Subject :&lt;BR /&gt;
    Security ID:        xx&lt;BR /&gt;
    Account Name:       XXXXXX$&lt;BR /&gt;
    Account Domain:     XXXX&lt;BR /&gt;
    Logon ID:       XXXX&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 14:14:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-get-blacklist-WinEventLog-Security-to-work/m-p/434598#M75874</guid>
      <dc:creator>dkeck</dc:creator>
      <dc:date>2019-01-28T14:14:05Z</dc:date>
    </item>
  </channel>
</rss>

