<?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: Splunk not reflecting correct REGEX Grouping in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30139#M6112</link>
    <description>&lt;P&gt;OK, I am going to assume that you are trying to do a field extraction. All you need is a props.conf with the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[snortPS]
EXTRACT-snortps_type = (\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)(\s\-\&amp;gt;\s)(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)(?P &amp;lt; snortps_type &amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this the result you are looking for ?&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://splunk-base.splunk.com//storage/Capture_2.png" alt="alt text" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 May 2013 16:18:15 GMT</pubDate>
    <dc:creator>JSapienza</dc:creator>
    <dc:date>2013-05-10T16:18:15Z</dc:date>
    <item>
      <title>Splunk not reflecting correct REGEX Grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30136#M6109</link>
      <description>&lt;P&gt;I am new to splunk and have been trying to set up my first transforms but I am having some issues.  I was hoping to get some help.&lt;/P&gt;

&lt;P&gt;Here is the scenario:&lt;/P&gt;

&lt;P&gt;Given this data:&lt;/P&gt;

&lt;P&gt;Time: 05/09-16:32:33.470574 &lt;BR /&gt;
event_ref: 0&lt;BR /&gt;
22.1.11.254 -&amp;gt; 17.96.40.171 (portscan) TCP Portsweep&lt;BR /&gt;
Priority Count: 3&lt;BR /&gt;
Connection Count: 9&lt;BR /&gt;
IP Count: 12&lt;BR /&gt;
Scanned IP Range: 17.158.28.47:204.0.4.104&lt;BR /&gt;
Port/Proto Count: 9&lt;BR /&gt;
Port/Proto Range: 80:12350&lt;/P&gt;

&lt;P&gt;And this transforms.conf&lt;/P&gt;

&lt;P&gt;[snortPSVarious]&lt;BR /&gt;
REGEX=(?m)(\d+.\d+.\d+.\d+)(\s+)(-&amp;gt;\s+)(\d+.\d+.\d+.\d+\s+)(.*\R)&lt;BR /&gt;
FORMAT=snortps_src_ip::$1 snortps_dir::$3  snortps_dst_ip::$4 snortps_type::$5&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Problem:  No matter what I try the snortps_type won't return "(portscan) TCP Portsweep".&lt;BR /&gt;
It actually matches (in Splunk) the rest of the string.  Oddly enough, when I test this SAME regex at:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://gskinner.com/RegExr/" target="_blank"&gt;http://gskinner.com/RegExr/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I would attach a screen shot but apparently I don't have enough "karma". &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Any thoughts out there?&lt;/P&gt;

&lt;P&gt;Best,&lt;BR /&gt;
-Roberto&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:52:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30136#M6109</guid>
      <dc:creator>rgarcia3904</dc:creator>
      <dc:date>2020-09-28T13:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk not reflecting correct REGEX Grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30137#M6110</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)(\s\-\&amp;gt;\s)(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)(.*)\
FORMAT = snortps_type::$4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;IMG src="http://splunk-base.splunk.com//storage/Capture_1.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2013 15:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30137#M6110</guid>
      <dc:creator>JSapienza</dc:creator>
      <dc:date>2013-05-10T15:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk not reflecting correct REGEX Grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30138#M6111</link>
      <description>&lt;P&gt;Unfortunately that does not work.  I get the same results as you do on the test site but when I integrate into Splunk and reload the field still contains the whole of the rest of the string.&lt;BR /&gt;
Could this be a bug in this version of Splunk?&lt;BR /&gt;
Thanks for your help.&lt;BR /&gt;
Best,&lt;BR /&gt;
Roberto&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2013 15:35:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30138#M6111</guid>
      <dc:creator>rgarcia3904</dc:creator>
      <dc:date>2013-05-10T15:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk not reflecting correct REGEX Grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30139#M6112</link>
      <description>&lt;P&gt;OK, I am going to assume that you are trying to do a field extraction. All you need is a props.conf with the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[snortPS]
EXTRACT-snortps_type = (\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)(\s\-\&amp;gt;\s)(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)(?P &amp;lt; snortps_type &amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this the result you are looking for ?&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://splunk-base.splunk.com//storage/Capture_2.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2013 16:18:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30139#M6112</guid>
      <dc:creator>JSapienza</dc:creator>
      <dc:date>2013-05-10T16:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk not reflecting correct REGEX Grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30140#M6113</link>
      <description>&lt;P&gt;No. &lt;BR /&gt;
The result I need is for snortps_type to have "(portscan) TCP Portsweep" and nothing more.&lt;/P&gt;

&lt;P&gt;Thanks for your help!&lt;/P&gt;

&lt;P&gt;Best,&lt;BR /&gt;
Roberto&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2013 16:23:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30140#M6113</guid>
      <dc:creator>rgarcia3904</dc:creator>
      <dc:date>2013-05-10T16:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk not reflecting correct REGEX Grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30141#M6114</link>
      <description>&lt;P&gt;My bad  try this one:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EXTRACT-snortps_type = (?im)\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b\s\-\&amp;gt;\s\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b(?P&amp;lt; snortps_type &amp;gt;.*)Priority
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;IMG src="http://splunk-base.splunk.com//storage/Capture_3.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2013 17:53:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30141#M6114</guid>
      <dc:creator>JSapienza</dc:creator>
      <dc:date>2013-05-10T17:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk not reflecting correct REGEX Grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30142#M6115</link>
      <description>&lt;P&gt;This works just fine!  Thanks!&lt;BR /&gt;
-Roberto&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2013 21:10:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-not-reflecting-correct-REGEX-Grouping/m-p/30142#M6115</guid>
      <dc:creator>rgarcia3904</dc:creator>
      <dc:date>2013-05-10T21:10:05Z</dc:date>
    </item>
  </channel>
</rss>

