<?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 How to use regex in field extraction? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-field-extraction/m-p/196335#M56611</link>
    <description>&lt;P&gt;I can't seem to get my regex to work as a field extraction.  below is an example string and the regex I'm trying to use.&lt;/P&gt;

&lt;P&gt;Sample string:&lt;BR /&gt;
    ab&amp;amp;q=john+schneider+singer+-actor&amp;amp;oq=john+schneider+singer+-actor&amp;amp;g&lt;/P&gt;

&lt;P&gt;Regex:&lt;BR /&gt;
    (?&amp;lt;=ab&amp;amp;q=)\S*(?=&amp;amp;oq)&lt;/P&gt;

&lt;P&gt;This is what I've been trying in Splunk:&lt;BR /&gt;
    rex field=url "(?&amp;lt;=ab&amp;amp;q=)\S*(?=&amp;amp;oq)(?&lt;FIELDNAME&gt;)"&lt;/FIELDNAME&gt;&lt;/P&gt;

&lt;P&gt;Basically I want to extract everything between "ab&amp;amp;q=" and "&amp;amp;oq"&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jun 2014 18:23:26 GMT</pubDate>
    <dc:creator>digital_alchemy</dc:creator>
    <dc:date>2014-06-11T18:23:26Z</dc:date>
    <item>
      <title>How to use regex in field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-field-extraction/m-p/196335#M56611</link>
      <description>&lt;P&gt;I can't seem to get my regex to work as a field extraction.  below is an example string and the regex I'm trying to use.&lt;/P&gt;

&lt;P&gt;Sample string:&lt;BR /&gt;
    ab&amp;amp;q=john+schneider+singer+-actor&amp;amp;oq=john+schneider+singer+-actor&amp;amp;g&lt;/P&gt;

&lt;P&gt;Regex:&lt;BR /&gt;
    (?&amp;lt;=ab&amp;amp;q=)\S*(?=&amp;amp;oq)&lt;/P&gt;

&lt;P&gt;This is what I've been trying in Splunk:&lt;BR /&gt;
    rex field=url "(?&amp;lt;=ab&amp;amp;q=)\S*(?=&amp;amp;oq)(?&lt;FIELDNAME&gt;)"&lt;/FIELDNAME&gt;&lt;/P&gt;

&lt;P&gt;Basically I want to extract everything between "ab&amp;amp;q=" and "&amp;amp;oq"&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2014 18:23:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-field-extraction/m-p/196335#M56611</guid>
      <dc:creator>digital_alchemy</dc:creator>
      <dc:date>2014-06-11T18:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use regex in field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-field-extraction/m-p/196336#M56612</link>
      <description>&lt;P&gt;I think you're looking for something like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;rex field=url "ab&amp;amp;q=(?&amp;lt;fieldname&amp;gt;\S*)&amp;amp;oq(.*)"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2014 18:44:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-field-extraction/m-p/196336#M56612</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2014-06-11T18:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use regex in field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-field-extraction/m-p/196337#M56613</link>
      <description>&lt;P&gt;Works great thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2014 19:01:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-field-extraction/m-p/196337#M56613</guid>
      <dc:creator>digital_alchemy</dc:creator>
      <dc:date>2014-06-11T19:01:48Z</dc:date>
    </item>
  </channel>
</rss>

