<?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 Regex - Works in regex101 but not Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Works-in-regex101-but-not-Splunk/m-p/325579#M97086</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;
why you say that doesn't run on Splunk?&lt;BR /&gt;
I tried this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal  
|head 1 
| eval ppp="Oct 24 18:43:57 openvpn[36372]: 66.103.224.123:59349 [username] Peer Connection Initiated with [AF_INET]66.103.224.123:59349" 
| rex field=ppp "^(?:[^ \n]* ){5}\[(?P&amp;lt;username&amp;gt;\w+)(?:\].*\])(?P&amp;lt;IP&amp;gt;[^:]+)" 
| table username IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I have &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;username    IP
username    66.103.224.123
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2017 07:57:46 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-10-25T07:57:46Z</dc:date>
    <item>
      <title>Splunk Regex - Works in regex101 but not Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Works-in-regex101-but-not-Splunk/m-p/325577#M97084</link>
      <description>&lt;P&gt;I've got a regex that's working in Regex101's editor, but when I paste it into Splunk I get garbage or no results:&lt;BR /&gt;
Regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(?:[^ \n]* ){5}\[(?P&amp;lt;username&amp;gt;\w+)(?:\].*\])(?P&amp;lt;IP&amp;gt;[^:]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample entries:&lt;BR /&gt;
Oct 24 18:43:57 openvpn[36372]: 66.103.224.123:59349 [username] Peer Connection Initiated with [AF_INET]66.103.224.123:59349&lt;BR /&gt;
Oct 24 18:28:54 openvpn[21337]: 66.103.224.123:50873 [username] Peer Connection Initiated with [AF_INET]66.103.224.123:50873&lt;/P&gt;

&lt;P&gt;URL:&lt;BR /&gt;
&lt;A href="https://regex101.com/r/by1mOW/7" target="_blank"&gt;https://regex101.com/r/by1mOW/7&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Works-in-regex101-but-not-Splunk/m-p/325577#M97084</guid>
      <dc:creator>JacobCarrell</dc:creator>
      <dc:date>2020-09-29T16:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regex - Works in regex101 but not Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Works-in-regex101-but-not-Splunk/m-p/325578#M97085</link>
      <description>&lt;P&gt;Forgot to add, Here's what Splunk captures for the IP:&lt;BR /&gt;
Initiated with [AF_INET]66.103.224.123&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 01:02:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Works-in-regex101-but-not-Splunk/m-p/325578#M97085</guid>
      <dc:creator>JacobCarrell</dc:creator>
      <dc:date>2017-10-25T01:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regex - Works in regex101 but not Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Works-in-regex101-but-not-Splunk/m-p/325579#M97086</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
why you say that doesn't run on Splunk?&lt;BR /&gt;
I tried this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal  
|head 1 
| eval ppp="Oct 24 18:43:57 openvpn[36372]: 66.103.224.123:59349 [username] Peer Connection Initiated with [AF_INET]66.103.224.123:59349" 
| rex field=ppp "^(?:[^ \n]* ){5}\[(?P&amp;lt;username&amp;gt;\w+)(?:\].*\])(?P&amp;lt;IP&amp;gt;[^:]+)" 
| table username IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I have &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;username    IP
username    66.103.224.123
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 07:57:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Works-in-regex101-but-not-Splunk/m-p/325579#M97086</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-10-25T07:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regex - Works in regex101 but not Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Works-in-regex101-but-not-Splunk/m-p/325580#M97087</link>
      <description>&lt;P&gt;Thanks, I didn't know you could do this. It turns out I'm using an app that provides predefined sourcetypes. I ran out of oomph last night after rewriting the regex to grab the IP from the first IP and STILL getting the same results, so somewhere in one of my props.conf or transforms.conf is a bad regex. I'll have to track it down tonight.&lt;/P&gt;

&lt;P&gt;For the record, this is syslogs from PFSense.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 16:51:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Works-in-regex101-but-not-Splunk/m-p/325580#M97087</guid>
      <dc:creator>JacobCarrell</dc:creator>
      <dc:date>2017-10-25T16:51:29Z</dc:date>
    </item>
  </channel>
</rss>

