<?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 extract a particular field from a URI in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239803#M71257</link>
    <description>&lt;P&gt;My data is coming like below in splunk&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;method=PUT uri=/AppA/USA/comp1/Refrence/20160120A123456/price query= httpstatus=200 bytes=7772 processtime=682 ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;method=PUT uri=/AppA/USA/comp2/tax query= httpstatus=200 bytes=7772 processtime=682 ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to get the last value after &lt;CODE&gt;/&lt;/CODE&gt; from the URI column and the average process time for that in a time frame.&lt;/P&gt;

&lt;P&gt;For example, for a day, I want to see the average time taken for service tax and price.&lt;/P&gt;

&lt;P&gt;And how do I get any value in between URI? For example, I want to get the country type from the above URI, and want to see the average time taken for each service in different countries.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jan 2016 20:05:50 GMT</pubDate>
    <dc:creator>jagdeepgupta813</dc:creator>
    <dc:date>2016-01-20T20:05:50Z</dc:date>
    <item>
      <title>How to extract a particular field from a URI in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239803#M71257</link>
      <description>&lt;P&gt;My data is coming like below in splunk&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;method=PUT uri=/AppA/USA/comp1/Refrence/20160120A123456/price query= httpstatus=200 bytes=7772 processtime=682 ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;method=PUT uri=/AppA/USA/comp2/tax query= httpstatus=200 bytes=7772 processtime=682 ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to get the last value after &lt;CODE&gt;/&lt;/CODE&gt; from the URI column and the average process time for that in a time frame.&lt;/P&gt;

&lt;P&gt;For example, for a day, I want to see the average time taken for service tax and price.&lt;/P&gt;

&lt;P&gt;And how do I get any value in between URI? For example, I want to get the country type from the above URI, and want to see the average time taken for each service in different countries.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 20:05:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239803#M71257</guid>
      <dc:creator>jagdeepgupta813</dc:creator>
      <dc:date>2016-01-20T20:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a particular field from a URI in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239804#M71258</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=uri "\/\w+\/(?&amp;lt;Country&amp;gt;\w+)" | rex field=uri "\/(?&amp;lt;Type&amp;gt;\w+)\s"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Should extract a field called "Country" and a field called "Type". I assume bytes, httpstatus, and processingtime are auto-extracted for you by Splunk since they're key=value pairs.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 20:53:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239804#M71258</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2016-01-20T20:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a particular field from a URI in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239805#M71259</link>
      <description>&lt;P&gt;You can do it all in one go by using this (no need to escape forward slashes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=uri "/\w+/(?&amp;lt;Country&amp;gt;\w+).*/(?&amp;lt;Service&amp;gt;\w+)$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jan 2016 21:08:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239805#M71259</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2016-01-20T21:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a particular field from a URI in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239806#M71260</link>
      <description>&lt;P&gt;why this is not working&lt;BR /&gt;
rex field=url "\/(?\d+)$"&lt;/P&gt;

&lt;P&gt;I tried this as well&lt;BR /&gt;
rex field=url "\/(?\d+)RETURN"&lt;/P&gt;

&lt;P&gt;However , this worked&lt;BR /&gt;
rex field=url "\/(?\d{10,})$"&lt;/P&gt;

&lt;P&gt;my url field has value like &lt;BR /&gt;
&lt;A href="http://IP:PORT/Folder1/rest/service1/1234/Stor3/001/12345678910/RETURN"&gt;http://IP:PORT/Folder1/rest/service1/1234/Stor3/001/12345678910/RETURN&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 01:13:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239806#M71260</guid>
      <dc:creator>jagdeepgupta813</dc:creator>
      <dc:date>2016-10-05T01:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a particular field from a URI in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239807#M71261</link>
      <description>&lt;P&gt;It was my bad, this worked&lt;/P&gt;

&lt;P&gt;rex field=url "\/(?\d+)\/RETURN"&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 01:15:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-particular-field-from-a-URI-in-Splunk/m-p/239807#M71261</guid>
      <dc:creator>jagdeepgupta813</dc:creator>
      <dc:date>2016-10-05T01:15:02Z</dc:date>
    </item>
  </channel>
</rss>

