<?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 How do you use the rex command to filter Windows security events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-filter-Windows-security-events/m-p/384420#M112272</link>
    <description>&lt;P&gt;Hi there, &lt;/P&gt;

&lt;P&gt;I'm trying to extract some data from Windows security logs and filter the counted results. &lt;/P&gt;

&lt;P&gt;This search doesn't work though — any help?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=something (EventCode="4732" OR EventCode="4728" OR EventCode="4756") 
| rex "(?i)Subject:W\r\n\tSecurity ID:\t\t(?P&amp;lt;Subject&amp;gt;.+)"  
| rex "(?i)Member:\W\r\n\tSecurity  ID:\t\t(?P&amp;lt;Member&amp;gt;.+)" 
| rex "(?i)Group:\W\r\n\tSecurity ID:\t\t(?P&amp;lt;Group&amp;gt;.+)"
| search group_obj_id="*admin*" OR group_obj_id="*adm*" OR group_obj_id="*admn*"
| convert ctime(_time) AS time
| eval Group_and_time=Group+"--"+time
| stats values(Group_and_time) as "Group added and Time added" dc(Group) as group_count by Member
| where group_count&amp;gt;1
| rename group_count as "Group Count"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 15 Feb 2019 11:52:00 GMT</pubDate>
    <dc:creator>swimena</dc:creator>
    <dc:date>2019-02-15T11:52:00Z</dc:date>
    <item>
      <title>How do you use the rex command to filter Windows security events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-filter-Windows-security-events/m-p/384420#M112272</link>
      <description>&lt;P&gt;Hi there, &lt;/P&gt;

&lt;P&gt;I'm trying to extract some data from Windows security logs and filter the counted results. &lt;/P&gt;

&lt;P&gt;This search doesn't work though — any help?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=something (EventCode="4732" OR EventCode="4728" OR EventCode="4756") 
| rex "(?i)Subject:W\r\n\tSecurity ID:\t\t(?P&amp;lt;Subject&amp;gt;.+)"  
| rex "(?i)Member:\W\r\n\tSecurity  ID:\t\t(?P&amp;lt;Member&amp;gt;.+)" 
| rex "(?i)Group:\W\r\n\tSecurity ID:\t\t(?P&amp;lt;Group&amp;gt;.+)"
| search group_obj_id="*admin*" OR group_obj_id="*adm*" OR group_obj_id="*admn*"
| convert ctime(_time) AS time
| eval Group_and_time=Group+"--"+time
| stats values(Group_and_time) as "Group added and Time added" dc(Group) as group_count by Member
| where group_count&amp;gt;1
| rename group_count as "Group Count"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Feb 2019 11:52:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-filter-Windows-security-events/m-p/384420#M112272</guid>
      <dc:creator>swimena</dc:creator>
      <dc:date>2019-02-15T11:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rex command to filter Windows security events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-filter-Windows-security-events/m-p/384421#M112273</link>
      <description>&lt;P&gt;First of all, your RegEx does not seem to work ... you have to make it multiline-matching, the case-instensitivity is not necessary. It can be eased down a bit as well. Next, line #5 is sort of redundant, as &lt;CODE&gt;group_obj_id="*adm*"&lt;/CODE&gt; covers the other two selections as well. The rest seems to work fine - at leat in my test environment.&lt;/P&gt;

&lt;P&gt;This does it for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=something (EventCode="4732" OR EventCode="4728" OR EventCode="4756") 
| rex "(?im)Subject:[^:]+:\t*(?P&amp;lt;Subject&amp;gt;.+)\n" 
| rex "(?im)Member:[^:]+:\t*(?P&amp;lt;Member&amp;gt;.+)\n" 
| rex "(?im)Group:[^:]+:\t*(?P&amp;lt;Group&amp;gt;.+)\n" 
| search group_obj_id="*adm*"
| convert ctime(_time) AS time 
| eval Group_and_time=Group+"--"+time 
| stats values(Group_and_time) as "Group added and Time added" dc(Group) as group_count by Member 
| where group_count&amp;gt;1 
| rename group_count as "Group Count"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Feb 2019 12:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-filter-Windows-security-events/m-p/384421#M112273</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-02-15T12:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rex command to filter Windows security events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-filter-Windows-security-events/m-p/384422#M112274</link>
      <description>&lt;P&gt;Thanks again @DMohn  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I'm getting results in the Events tab, however, I can't display any statistics out of it. &lt;BR /&gt;
I'll try to cut some of the code and see whether anything changes...&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 13:17:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rex-command-to-filter-Windows-security-events/m-p/384422#M112274</guid>
      <dc:creator>swimena</dc:creator>
      <dc:date>2019-02-15T13:17:25Z</dc:date>
    </item>
  </channel>
</rss>

