<?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: Regex assistance in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311817#M93429</link>
    <description>&lt;P&gt;That's exactly it ; -)&lt;/P&gt;</description>
    <pubDate>Mon, 20 Feb 2017 18:03:12 GMT</pubDate>
    <dc:creator>ddrillic</dc:creator>
    <dc:date>2017-02-20T18:03:12Z</dc:date>
    <item>
      <title>Regex assistance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311814#M93426</link>
      <description>&lt;P&gt;We have a field such as - &lt;CODE&gt;activity="POST-&amp;gt;/cirrus/v1.0/providers"&lt;/CODE&gt;&lt;BR /&gt;
We would like to extract everything after the &lt;CODE&gt;POST-&amp;gt;/cirrus/v1.0/&lt;/CODE&gt; part.&lt;/P&gt;

&lt;P&gt;What would be a way to do it?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 17:36:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311814#M93426</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2017-02-20T17:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assistance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311815#M93427</link>
      <description>&lt;P&gt;Sorry sorry - &lt;CODE&gt;| rex  field=activity "POST-&amp;gt;/cirrus/v1.0/(?&amp;lt;activity_clean&amp;gt;[a-z]+)"&lt;/CODE&gt; did it...&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 17:50:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311815#M93427</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2017-02-20T17:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assistance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311816#M93428</link>
      <description>&lt;P&gt;1) is "POST" the only verb you want it for?  2) are there always exactly three slashes in the part you don't want?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 18:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311816#M93428</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-20T18:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assistance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311817#M93429</link>
      <description>&lt;P&gt;That's exactly it ; -)&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 18:03:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311817#M93429</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2017-02-20T18:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assistance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311818#M93430</link>
      <description>&lt;P&gt;This will pull that exact section out of a field called myfield and place it into a field called otherstuff&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=myfield  "POST-&amp;gt;\/[^\/]+\/[^\/]+\/(?&amp;lt;otherstuff&amp;gt;[^\"]+)" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will do that and also put the verb into a field called whatverb.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=myfield  "(?&amp;lt;whatverb&amp;gt;POST|DELETE|GET|PUT)-&amp;gt;\/[^\/]+\/[^\/]+\/(?&amp;lt;otherstuff&amp;gt;[^\"]+)" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Feb 2017 18:07:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311818#M93430</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-20T18:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assistance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311819#M93431</link>
      <description>&lt;P&gt;Perfect!!!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 19:29:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311819#M93431</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2017-02-20T19:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assistance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311820#M93432</link>
      <description>&lt;P&gt;Ah, you meant that value within quotes was the value of the activity field.&lt;/P&gt;

&lt;P&gt;I'd suggest changing that to one of the following -&lt;BR /&gt;
    | rex field=activity "POST-&amp;gt;/cirrus/v1.0/(?&lt;ACTIVITY_CLEAN&gt;.+)" &lt;BR /&gt;
or&lt;BR /&gt;
    | rex field=activity "POST-&amp;gt;/cirrus/v1.0/(?&lt;ACTIVITY_CLEAN&gt;\w+)" &lt;/ACTIVITY_CLEAN&gt;&lt;/ACTIVITY_CLEAN&gt;&lt;/P&gt;

&lt;P&gt;...since you probably can't be sure that it will always be only lower-case alpha characters.  You also don't know when the cirrus version might change, so you might want to wildcard that as well.  I tested this as below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval activity="POST-&amp;gt;/cirrus/v1.0/providers"  
| rex field=activity  "POST-&amp;gt;/cirrus/[^/]+/(?&amp;lt;activity_clean&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;I was a little surprised the slashes didn't have to be escaped, although the code DID accept escaping them.  Live and learn.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 19:40:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311820#M93432</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-20T19:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assistance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311821#M93433</link>
      <description>&lt;P&gt;please accept your answer to close the question.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 19:40:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311821#M93433</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-20T19:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assistance</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311822#M93434</link>
      <description>&lt;P&gt;I was surprised also about the non-escaping ; -) &lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 19:41:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-assistance/m-p/311822#M93434</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2017-02-20T19:41:59Z</dc:date>
    </item>
  </channel>
</rss>

