<?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: How to prevent regex from matching till end of event? Extracting Group names from EventCode 4627 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-regex-from-matching-till-end-of-event-Extracting/m-p/698362#M237149</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That worked perfectly.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Sep 2024 02:56:26 GMT</pubDate>
    <dc:creator>att35</dc:creator>
    <dc:date>2024-09-06T02:56:26Z</dc:date>
    <item>
      <title>How to prevent regex from matching till end of event? Extracting Group names from EventCode 4627</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-regex-from-matching-till-end-of-event-Extracting/m-p/698313#M237139</link>
      <description>&lt;P&gt;Need some help in extracting Group Membership details from Windows Event Code 4627.&lt;/P&gt;&lt;P&gt;As explained in this answer,&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Regex-not-working-as-expected/m-p/470417" target="_self"&gt;https://community.splunk.com/t5/Splunk-Search/Regex-not-working-as-expected/m-p/470417&lt;/A&gt;&lt;/P&gt;&lt;P&gt;following seems to be working to extract Group_name, but capture doesn't stop once the group list ends. Instead, it continues to match everything till end of line. I experimented with (?ms) and (?m) but didnt have any succes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"(?ms)(?:^Group Membership:\t\t\t|\G(?!^))\r?\n[\t ]*(?:[^\\\r\n]*\\\)*(?&amp;lt;Group_name&amp;gt;(.+))"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;09/04/2024 11:59:59 PM
LogName=Security
EventCode=4627
EventType=0
ComputerName=DCServer.domain.x.y
SourceName=Microsoft Windows security auditing.
Type=Information
RecordNumber=64222222324
Keywords=Audit Success
TaskCategory=Group Membership
OpCode=Info
Message=Group membership information.

Subject:
	Security ID:		NT AUTHORITY\SYSTEM
	Account Name:		DCServer$
	Account Domain:		Domain
	Logon ID:		0x1111

Logon Type:			3

New Logon:
	Security ID:		Domain\Account
	Account Name:		Account
	Account Domain:		Domain
	Logon ID:		0x5023236

Event in sequence:		1 of 1

Group Membership:			
		Domain\Group1
		Group2
		BUILTIN\Group3
		BUILTIN\Group4
		BUILTIN\Group5
		BUILTIN\Group6
		NT AUTHORITY\NETWORK
		NT AUTHORITY\Authenticated Users
		Domain\Group7

The subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.

The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).

The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.

This event is generated when the Audit Group Membership subcategory is configured.  The Logon ID field can be used to correlate this event with the corresponding user logon event as well as to any other security audit events generated during this logon session.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use this regex, it does capture starting from the Group list but continues on till the end of event.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Group_name.png" style="width: 581px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32544i91448A11A5AEADD2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Group_name.png" alt="Group_name.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How can I tell regex to stop matching once the group list ends? Also, this regex seems to be putting all groups as a single match. Is it possible to make it multi-valued, so that we can count total number of groups present in a given event, e.g. 9 groups in the event example above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;~Abhi&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 17:12:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-regex-from-matching-till-end-of-event-Extracting/m-p/698313#M237139</guid>
      <dc:creator>att35</dc:creator>
      <dc:date>2024-09-05T17:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent regex from matching till end of event? Extracting Group names from EventCode 4627</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-regex-from-matching-till-end-of-event-Extracting/m-p/698316#M237141</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex max_match=0 "(?m)^\t\t+(?&amp;lt;Group_name&amp;gt;.+)$"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Sep 2024 18:17:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-regex-from-matching-till-end-of-event-Extracting/m-p/698316#M237141</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-09-05T18:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent regex from matching till end of event? Extracting Group names from EventCode 4627</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-regex-from-matching-till-end-of-event-Extracting/m-p/698362#M237149</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That worked perfectly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 02:56:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-regex-from-matching-till-end-of-event-Extracting/m-p/698362#M237149</guid>
      <dc:creator>att35</dc:creator>
      <dc:date>2024-09-06T02:56:26Z</dc:date>
    </item>
  </channel>
</rss>

