<?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: Extract Second field from url in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494667#M137880</link>
    <description>&lt;P&gt;As far as the URL toolbox, I don't have control over my company's Splunk deployment, so I can't install that. It does seem very helpful though, I've seen it recommended a ton of places&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2020 20:32:06 GMT</pubDate>
    <dc:creator>michaelrodr</dc:creator>
    <dc:date>2020-01-22T20:32:06Z</dc:date>
    <item>
      <title>Extract Second field from url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494662#M137875</link>
      <description>&lt;P&gt;AbsoluteUri=&lt;A href="https://website.api.net/hch6348/relay/6bcb449b-7d85-4f71-a6f4-fae37808627f-udcc1.crp.hs.com/script/wnbr.dll"&gt;https://website.api.net/hch6348/relay/6bcb449b-7d85-4f71-a6f4-fae37808627f-udcc1.crp.hs.com/script/wnbr.dll&lt;/A&gt;&lt;BR /&gt;
AbsoluteUri=&lt;A href="https://website.api.net/hch6348/health"&gt;https://website.api.net/hch6348/health&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have a field with a uri that looks like either of the above. I want to extract the word "relay" or "health" from the url into a field called apiEndpoint. &lt;/P&gt;

&lt;P&gt;I've tried piping the field into this regex, but I cannot get it right: &lt;CODE&gt;| rex "AbsoluteUri\":\"((\/.+?)(\/.+?)?&amp;lt;apiEndpoint&amp;gt;\/?)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I have not been able to find an example like this on the Splunk forums. Any help would be appreciated&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 19:28:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494662#M137875</guid>
      <dc:creator>michaelrodr</dc:creator>
      <dc:date>2020-01-22T19:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Second field from url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494663#M137876</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rex field=AbsoluteUri "https://\w+.\w+\w/\w+/(?&amp;lt;uri&amp;gt;[^(\/)|(\s)]+)" | table uri&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 20:19:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494663#M137876</guid>
      <dc:creator>Anantha123</dc:creator>
      <dc:date>2020-01-22T20:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Second field from url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494664#M137877</link>
      <description>&lt;P&gt;This should do it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "AbsoluteUri=https:\/\/[^\/]+\/[^\/]+\/(?&amp;lt;apiEndpoint&amp;gt;[^\/]+|$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, the URL Toolbox app may be helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 20:23:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494664#M137877</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-01-22T20:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Second field from url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494665#M137878</link>
      <description>&lt;P&gt;Thank you so much! This worked perfectly for me. Accepted answer&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 20:27:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494665#M137878</guid>
      <dc:creator>michaelrodr</dc:creator>
      <dc:date>2020-01-22T20:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Second field from url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494666#M137879</link>
      <description>&lt;P&gt;I'm sorry, this didn't work for me. I accepted richgalloway's answer.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 20:28:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494666#M137879</guid>
      <dc:creator>michaelrodr</dc:creator>
      <dc:date>2020-01-22T20:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Second field from url</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494667#M137880</link>
      <description>&lt;P&gt;As far as the URL toolbox, I don't have control over my company's Splunk deployment, so I can't install that. It does seem very helpful though, I've seen it recommended a ton of places&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 20:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Second-field-from-url/m-p/494667#M137880</guid>
      <dc:creator>michaelrodr</dc:creator>
      <dc:date>2020-01-22T20:32:06Z</dc:date>
    </item>
  </channel>
</rss>

