<?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 Using REGEX with multiple parameters in the same transforms.conf instance in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697331#M20054</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I'm trying to filter out some logs in the IA-WindowsSecurity Application.&lt;/P&gt;
&lt;P&gt;The indexed values are when:&lt;/P&gt;
&lt;P&gt;- The EventCode=4634 AND the Security_ID="*$"&lt;/P&gt;
&lt;P&gt;I created an app deployed on an index with the following props and transforms config:&lt;/P&gt;
&lt;H3&gt;Props.conf&lt;/H3&gt;
&lt;LI-CODE lang="markup"&gt;[WinEventLog]
TRANSFORMS-remove_computer_logoff = remove_logoff&lt;/LI-CODE&gt;
&lt;H3&gt;Transforms.conf&lt;/H3&gt;
&lt;LI-CODE lang="markup"&gt;[remove_logoff]
REGEX = 
DEST_KEY = queue
FORMAT = nullQueue

I made the following regex for matching the event:

- EventCode=4634

- Security_ID=".*\$$"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;I'm not sure how to correctly "put together" these two REGEXES.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;I did a lot of testing with different types of regexes (in PCRE Format), but I wasn't able to make it work.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone please help me?&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2024 15:00:15 GMT</pubDate>
    <dc:creator>AndrewF17</dc:creator>
    <dc:date>2024-08-28T15:00:15Z</dc:date>
    <item>
      <title>Using REGEX with multiple parameters in the same transforms.conf instance</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697331#M20054</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I'm trying to filter out some logs in the IA-WindowsSecurity Application.&lt;/P&gt;
&lt;P&gt;The indexed values are when:&lt;/P&gt;
&lt;P&gt;- The EventCode=4634 AND the Security_ID="*$"&lt;/P&gt;
&lt;P&gt;I created an app deployed on an index with the following props and transforms config:&lt;/P&gt;
&lt;H3&gt;Props.conf&lt;/H3&gt;
&lt;LI-CODE lang="markup"&gt;[WinEventLog]
TRANSFORMS-remove_computer_logoff = remove_logoff&lt;/LI-CODE&gt;
&lt;H3&gt;Transforms.conf&lt;/H3&gt;
&lt;LI-CODE lang="markup"&gt;[remove_logoff]
REGEX = 
DEST_KEY = queue
FORMAT = nullQueue

I made the following regex for matching the event:

- EventCode=4634

- Security_ID=".*\$$"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;I'm not sure how to correctly "put together" these two REGEXES.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;I did a lot of testing with different types of regexes (in PCRE Format), but I wasn't able to make it work.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone please help me?&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 15:00:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697331#M20054</guid>
      <dc:creator>AndrewF17</dc:creator>
      <dc:date>2024-08-28T15:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using REGEX with multiple parameters in the same transforms.conf instance</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697472#M20071</link>
      <description>&lt;P&gt;Try putting the two expressions together separated by &lt;FONT face="courier new,courier"&gt;[\s\S]+&lt;/FONT&gt; to represent any intervening text.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EventCode=4634[\s\S]+Security_ID=".+?\$$"&lt;/LI-CODE&gt;&lt;P&gt;If the order of fields might vary, use this variation to match both orders.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(?:EventCode=4634[\s\S]+Security_ID=".+?\$$")|(?:Security_ID=".+?\$$"[\s\S]+EventCode=4634)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Aug 2024 14:19:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697472#M20071</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-08-27T14:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using REGEX with multiple parameters in the same transforms.conf instance</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697480#M20072</link>
      <description>&lt;P&gt;One way is to do it as &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt; showed - with a composite regex accounting for both orders of fields (Just include possible whitespaces - I don't remember if they are included in windows events or not).&lt;/P&gt;&lt;P&gt;Another way is to use INGEST_EVAL and use something like this for your eval&lt;/P&gt;&lt;PRE&gt;queue=if(match(first_regex_and_so_on) AND match(second_regex...), "nullQueue", queue)&lt;/PRE&gt;&lt;P&gt;Be aware thought that it won't work for the events from inputs with renderXml=true.&lt;/P&gt;&lt;P&gt;Anyway, additionally you could look into filtering out those values even earlier - in your forwarder's input's stanza using blacklisting.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 15:18:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697480#M20072</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-27T15:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using REGEX with multiple parameters in the same transforms.conf instance</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697569#M20079</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;I tried the following configuration in my transforms.conf:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[remove_logoff]
INGEST_EVAL = queue=if(match(_raw,"EventCode=4634") AND match(_raw,"Security\sID:[\s]+.*\$"), "nullQueue", queue)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;props.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[WinEventLog]
TRANSFORMS-remove_computer_logoff = remove_logoff&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;But after I run the query, I still get the unwanted logs. I tried to make the query on the search as well to check if the regex were right and everything seems fine.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* sourcetype=WinEventLog
| eval result=if(match(_raw,"EventCode=4634") AND match(_raw,"Security\sID:[\s]+.*\$"), "Filter", "No need to filter this log")
| stats count by host, result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AndrewF17_1-1724842479988.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32442iDCDBE51DF988F674/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AndrewF17_1-1724842479988.png" alt="AndrewF17_1-1724842479988.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. I cannot do a blacklist directly on the hosts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 10:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697569#M20079</guid>
      <dc:creator>AndrewF17</dc:creator>
      <dc:date>2024-08-28T10:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using REGEX with multiple parameters in the same transforms.conf instance</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697585#M20080</link>
      <description>&lt;P&gt;AFAIR I had mixed results with transform not containing anything in the REGEX field. Try to explicitly add&lt;/P&gt;&lt;PRE&gt;REGEX = .&lt;/PRE&gt;&lt;P&gt;to match anything to the transform.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 11:59:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697585#M20080</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-28T11:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using REGEX with multiple parameters in the same transforms.conf instance</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697588#M20081</link>
      <description>&lt;P&gt;I tried this conf:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[remove_logoff]
REGEX = "(?:EventCode=4634)"
INGEST_EVAL = queue=if(match(_raw,"Security\sID:[\s]+.*\$"), "nullQueue", queue)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and also with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;REGEX = .&lt;/LI-CODE&gt;&lt;P&gt;But in both cases I'm still getting logs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 13:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697588#M20081</guid>
      <dc:creator>AndrewF17</dc:creator>
      <dc:date>2024-08-28T13:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using REGEX with multiple parameters in the same transforms.conf instance</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697589#M20082</link>
      <description>&lt;P&gt;OK. I'd try to verify whether the transform is called at all. I have a feeling that it is not for some reason.&lt;/P&gt;&lt;P&gt;You can for testing create some "sure fire" transform and check if it is being applied.&lt;/P&gt;&lt;P&gt;Are you sure you're doing it on the right component?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 13:16:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697589#M20082</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-28T13:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using REGEX with multiple parameters in the same transforms.conf instance</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697591#M20083</link>
      <description>&lt;P&gt;Unfortunately, in both cases doesn't work.&lt;/P&gt;&lt;P&gt;I tried also to work with the raw logs on regex101 and I came up with this regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EventCode=4634+[^$]+Security ID:\s+.*\$&lt;/LI-CODE&gt;&lt;P&gt;But I still getting logs.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 13:27:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-REGEX-with-multiple-parameters-in-the-same-transforms-conf/m-p/697591#M20083</guid>
      <dc:creator>AndrewF17</dc:creator>
      <dc:date>2024-08-28T13:27:25Z</dc:date>
    </item>
  </channel>
</rss>

