<?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: Unable to continue after using a regular expression to extract a new field. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160789#M45469</link>
    <description>&lt;P&gt;as suggested above a capture group is needed. also the field name is needed within the capture group.&lt;/P&gt;

&lt;P&gt;that alone did not work for me. I actually needed to add ?P after the first parenthesis in the capture group. as an example.&lt;/P&gt;

&lt;P&gt;(?PYourRegex),&lt;/P&gt;</description>
    <pubDate>Sat, 27 Apr 2019 20:38:29 GMT</pubDate>
    <dc:creator>000datageek</dc:creator>
    <dc:date>2019-04-27T20:38:29Z</dc:date>
    <item>
      <title>Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160779#M45459</link>
      <description>&lt;P&gt;This is day 2 working with splunk.  I want to extract a portion of an xml printout in the logs.  My regex works fine, but splunk does not let me continue.  Note that not all my events will have a match for my regex - in that case I want the field to just be blank.&lt;/P&gt;

&lt;P&gt;Am I doing something wrong here?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\w|\W+&amp;lt;externalBANID&amp;gt;[0-9]+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/535iEC29410D514B41A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 20:13:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160779#M45459</guid>
      <dc:creator>jpetrides</dc:creator>
      <dc:date>2015-08-04T20:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160780#M45460</link>
      <description>&lt;P&gt;You don't have a capturing group in your regex string.  Splunk won't extract a field without one.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 21:04:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160780#M45460</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-04T21:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160781#M45461</link>
      <description>&lt;P&gt;@richgalloway is correct, you need to wrap your regex in a capturing group, ()&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 21:49:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160781#M45461</guid>
      <dc:creator>dolivasoh</dc:creator>
      <dc:date>2015-08-04T21:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160782#M45462</link>
      <description>&lt;P&gt;Thanks!  I think I need to do a little more regex homework to get this to work the way I want.  I really appreciate the quick responses!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 15:22:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160782#M45462</guid>
      <dc:creator>jpetrides</dc:creator>
      <dc:date>2015-08-05T15:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160783#M45463</link>
      <description>&lt;P&gt;The best way I've found to learn (or teach) this topic is to use the GUI feature at first rather than try to write your own regex from scratch. If you have a complex pattern you think it won't pick up on, using the 'write my own' is certainly more robust, but you can grab the syntax and save yourself a lot of time digging using the 'Show Regular Expression" link using the regular GUI flow (rather than the "I prefer to write my own")&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 15:34:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160783#M45463</guid>
      <dc:creator>snalonzo</dc:creator>
      <dc:date>2015-08-05T15:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160784#M45464</link>
      <description>&lt;P&gt;Hi Snalonzo,&lt;/P&gt;

&lt;P&gt;Thanks for the suggestion - I tried that after reading your post and it can't seem to figure out the field correctly.  I think this will work for most other fields.&lt;/P&gt;

&lt;P&gt;Part of my problem is that I'm trying to parse out xml fields from within a log file that has a bunch of other java/weblogic text based noise in it.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2015 15:29:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160784#M45464</guid>
      <dc:creator>jpetrides</dc:creator>
      <dc:date>2015-08-06T15:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160785#M45465</link>
      <description>&lt;P&gt;Thanks for the reply.  Now I am here.&lt;/P&gt;

&lt;P&gt;([0-9]+)&amp;lt;\/ns3:externalBANId&amp;gt;&lt;/P&gt;

&lt;P&gt;However, it is still not letting me save, so something is still wrong with my regex.  I defined the capturing group as the set of digits between those two strings.  Still, it doesn't seem to like it.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2015 15:31:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160785#M45465</guid>
      <dc:creator>jpetrides</dc:creator>
      <dc:date>2015-08-06T15:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160786#M45466</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;(&amp;lt;whatever_name_you_want&amp;gt;[0-9]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With the above, ([0-9]+), you are matching a number between 0-9, 1 or more times, but are not naming that anything, so its not letting you save that thing (because Splunk would do nothing with that matching).&lt;/P&gt;

&lt;P&gt;Anything outside of the parenthesis is outside of the capture, the first thing in the paren should be &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fieldname&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then the pattern you want to extract, then close paren, then anything after that pattern that further restricts the match.&lt;/P&gt;

&lt;P&gt;Regex can be tricky at first, and certainly Splunk has its own regex quirks, but it gets easier - we promise &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2015 17:19:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160786#M45466</guid>
      <dc:creator>snalonzo</dc:creator>
      <dc:date>2015-08-06T17:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160787#M45467</link>
      <description>&lt;P&gt;This did the trick:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;\(?[0-9]+)\&amp;lt;\/ns3:externalBANId\&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;it pulled out the digits between the two tags and assigned it the BAN_ID name.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2015 17:58:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160787#M45467</guid>
      <dc:creator>jpetrides</dc:creator>
      <dc:date>2015-08-06T17:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160788#M45468</link>
      <description>&lt;P&gt;(?[0-9]+)&amp;lt;\/ns3:externalBANId&amp;gt;&lt;/P&gt;

&lt;P&gt;I got it!  Thanks for the help.  Defining the field name was the part that I was missing.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2015 18:00:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160788#M45468</guid>
      <dc:creator>jpetrides</dc:creator>
      <dc:date>2015-08-06T18:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to continue after using a regular expression to extract a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160789#M45469</link>
      <description>&lt;P&gt;as suggested above a capture group is needed. also the field name is needed within the capture group.&lt;/P&gt;

&lt;P&gt;that alone did not work for me. I actually needed to add ?P after the first parenthesis in the capture group. as an example.&lt;/P&gt;

&lt;P&gt;(?PYourRegex),&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2019 20:38:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-continue-after-using-a-regular-expression-to-extract-a/m-p/160789#M45469</guid>
      <dc:creator>000datageek</dc:creator>
      <dc:date>2019-04-27T20:38:29Z</dc:date>
    </item>
  </channel>
</rss>

