<?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: Invalid regex when using `|` in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Invalid-regex-when-using/m-p/22662#M560</link>
    <description>&lt;P&gt;Not sure why but the same regex using "(x|y)" that did not work in the Field Extractor works OK when directly done in Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype="mapfluence" | head 10000 | rex "(%3D|=)(?P&amp;lt;FIELDNAME&amp;gt;[^=^(%3D)]+)[_.]geom" | top 50 FIELDNAME
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 10 Apr 2012 01:56:48 GMT</pubDate>
    <dc:creator>boris</dc:creator>
    <dc:date>2012-04-10T01:56:48Z</dc:date>
    <item>
      <title>Invalid regex when using `|`</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Invalid-regex-when-using/m-p/22660#M558</link>
      <description>&lt;P&gt;I need to capture both  "D" OR "=" using (D|=).&lt;/P&gt;

&lt;P&gt;Editing the regex of the field extractor this works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;=(?P&amp;lt;FIELDNAME&amp;gt;[a-zA-Z0-9_.]+)[_.]geom
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But why does this not work?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(D|=)(?P&amp;lt;FIELDNAME&amp;gt;[a-zA-Z0-9_.]+)[_.]geom
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Its returns:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Invalid regex: no named extraction at position 0 (i.e., "(D|=)(?P&amp;lt;F..."). Expected "(?P&amp;lt;variable&amp;gt;pattern)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Apr 2012 23:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Invalid-regex-when-using/m-p/22660#M558</guid>
      <dc:creator>boris</dc:creator>
      <dc:date>2012-04-09T23:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid regex when using `|`</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Invalid-regex-when-using/m-p/22661#M559</link>
      <description>&lt;P&gt;Sounds like a quirk in the field extractor, assuming that every capturing group has to have a named variable to go with it.  A suitable workaround might be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[|=](?P&amp;lt;FIELDNAME&amp;gt;[a-zA-Z0-9_.]+)[_.]geom
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Apr 2012 00:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Invalid-regex-when-using/m-p/22661#M559</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2012-04-10T00:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid regex when using `|`</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Invalid-regex-when-using/m-p/22662#M560</link>
      <description>&lt;P&gt;Not sure why but the same regex using "(x|y)" that did not work in the Field Extractor works OK when directly done in Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype="mapfluence" | head 10000 | rex "(%3D|=)(?P&amp;lt;FIELDNAME&amp;gt;[^=^(%3D)]+)[_.]geom" | top 50 FIELDNAME
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Apr 2012 01:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Invalid-regex-when-using/m-p/22662#M560</guid>
      <dc:creator>boris</dc:creator>
      <dc:date>2012-04-10T01:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid regex when using `|`</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Invalid-regex-when-using/m-p/22663#M561</link>
      <description>&lt;P&gt;I think it's a bug in the field extractor.  It is making an assumption that every regex capturing group has a field name.  The &lt;CODE&gt;rex&lt;/CODE&gt; search command makes no such assumption.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 02:01:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Invalid-regex-when-using/m-p/22663#M561</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2012-04-10T02:01:35Z</dc:date>
    </item>
  </channel>
</rss>

