<?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 Splunkism Regex? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557138#M92199</link>
    <description>&lt;P&gt;When using PCRE regex to split a field into components, I find it frustrating.&amp;nbsp; I know my regex works as I've validated this in both regex101 and debuggex.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="debuggex.jpg" style="width: 882px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14812iDBDC0BF7585D045B/image-size/large?v=v2&amp;amp;px=999" role="button" title="debuggex.jpg" alt="debuggex.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;(?:.*?)(?P&amp;lt;ClientIP&amp;gt;(?:\d{1,3}\.){3}\d{1,3}|(?:(?:[0-9a-f]{1,4}(?::+)?){0,7}:+[0-9a-f]+))[,\n\r]+(?:(?:[\+](?P&amp;lt;LB_IP&amp;gt;[^:](?:\d{1,3}\.){3}\d{1,3}):(?P&amp;lt;LB_Port&amp;gt;\d+)))?&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this is extracting details from the IIS X_Forwarded_For field.&amp;nbsp; The supplied log data that was parsed extracted perfectly on both platforms and even using "grep -P".&amp;nbsp; But in Splunk, I only get a full extraction when the following format is observed.&lt;/P&gt;&lt;P&gt;123.123.123.123,+123.123.123.123,+123.123.123.123:12345&lt;/P&gt;&lt;P&gt;If&amp;nbsp; the final ip:port is missing from the event, only the first IP is captured&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;123.123.123.123&lt;/FONT&gt;,+123.123.123.123&lt;/P&gt;&lt;P&gt;I've had similar experiences over the years with Splunk, so I'm wondering if my regex fu is rubbish, regex validators are wrong or splunk has a bug that's never been fixed.&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 13:36:11 GMT</pubDate>
    <dc:creator>cdstealer</dc:creator>
    <dc:date>2021-06-25T13:36:11Z</dc:date>
    <item>
      <title>Splunkism Regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557138#M92199</link>
      <description>&lt;P&gt;When using PCRE regex to split a field into components, I find it frustrating.&amp;nbsp; I know my regex works as I've validated this in both regex101 and debuggex.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="debuggex.jpg" style="width: 882px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14812iDBDC0BF7585D045B/image-size/large?v=v2&amp;amp;px=999" role="button" title="debuggex.jpg" alt="debuggex.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;(?:.*?)(?P&amp;lt;ClientIP&amp;gt;(?:\d{1,3}\.){3}\d{1,3}|(?:(?:[0-9a-f]{1,4}(?::+)?){0,7}:+[0-9a-f]+))[,\n\r]+(?:(?:[\+](?P&amp;lt;LB_IP&amp;gt;[^:](?:\d{1,3}\.){3}\d{1,3}):(?P&amp;lt;LB_Port&amp;gt;\d+)))?&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this is extracting details from the IIS X_Forwarded_For field.&amp;nbsp; The supplied log data that was parsed extracted perfectly on both platforms and even using "grep -P".&amp;nbsp; But in Splunk, I only get a full extraction when the following format is observed.&lt;/P&gt;&lt;P&gt;123.123.123.123,+123.123.123.123,+123.123.123.123:12345&lt;/P&gt;&lt;P&gt;If&amp;nbsp; the final ip:port is missing from the event, only the first IP is captured&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;123.123.123.123&lt;/FONT&gt;,+123.123.123.123&lt;/P&gt;&lt;P&gt;I've had similar experiences over the years with Splunk, so I'm wondering if my regex fu is rubbish, regex validators are wrong or splunk has a bug that's never been fixed.&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 13:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557138#M92199</guid>
      <dc:creator>cdstealer</dc:creator>
      <dc:date>2021-06-25T13:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splunkism Regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557188#M92205</link>
      <description>&lt;P&gt;If you posted the regex as text rather than an image then we could test it ourselves to better help you.&lt;/P&gt;&lt;P&gt;Where did you define the regex in Splunk (props.conf, transforms.conf, Add Data Wizard, etc.)?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 12:36:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557188#M92205</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-06-25T12:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunkism Regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557190#M92207</link>
      <description>&lt;P&gt;Hi Richard,&amp;nbsp; The regex is defined in transforms and called by props.&lt;/P&gt;&lt;P&gt;Apologies, that would be useful &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Added to the top&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 13:36:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557190#M92207</guid>
      <dc:creator>cdstealer</dc:creator>
      <dc:date>2021-06-25T13:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Splunkism Regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557193#M92208</link>
      <description>&lt;P&gt;Which version of splunk are you using as this may be a factor too?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 13:09:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557193#M92208</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-25T13:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunkism Regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557198#M92209</link>
      <description>&lt;P&gt;We're running 8.1.3 currently.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 13:27:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557198#M92209</guid>
      <dc:creator>cdstealer</dc:creator>
      <dc:date>2021-06-25T13:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunkism Regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557219#M92212</link>
      <description>&lt;P class="lia-align-left"&gt;In Splunk, the default behavior is to keep only the first match.&amp;nbsp; To accept multiple matches, use the &lt;FONT face="courier new,courier"&gt;REPEAT_MATCH&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;MV_ADD&lt;/FONT&gt; settings.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 16:37:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunkism-Regex/m-p/557219#M92212</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-06-25T16:37:23Z</dc:date>
    </item>
  </channel>
</rss>

