<?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 Regex for uri path in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182443#M52577</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm having trouble extracting the uri_path of my log files.&lt;/P&gt;

&lt;P&gt;Here's an example of a line in my log file&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;CODE&gt;115.252.41.38 "65.165.121.16" - &lt;A href="https://community.splunk.com/www.site.com" target="test_blank"&gt;www.site.com&lt;/A&gt; [27/Feb/2014:23:29:59 -0500] "GET /images/focus/gallery/?zipCode=70006&amp;amp;distance=50 HTTP/1.1" 200 67362 1 esds036b.md5.site.com:9789 "-" "Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53"&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I'm trying to extract out "/images/focus/gallery/" with a Regex, but am having difficulties in doing so.  Any help is appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Mar 2014 19:49:50 GMT</pubDate>
    <dc:creator>loadtest</dc:creator>
    <dc:date>2014-03-11T19:49:50Z</dc:date>
    <item>
      <title>Regex for uri path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182443#M52577</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm having trouble extracting the uri_path of my log files.&lt;/P&gt;

&lt;P&gt;Here's an example of a line in my log file&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;CODE&gt;115.252.41.38 "65.165.121.16" - &lt;A href="https://community.splunk.com/www.site.com" target="test_blank"&gt;www.site.com&lt;/A&gt; [27/Feb/2014:23:29:59 -0500] "GET /images/focus/gallery/?zipCode=70006&amp;amp;distance=50 HTTP/1.1" 200 67362 1 esds036b.md5.site.com:9789 "-" "Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53"&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I'm trying to extract out "/images/focus/gallery/" with a Regex, but am having difficulties in doing so.  Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 19:49:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182443#M52577</guid>
      <dc:creator>loadtest</dc:creator>
      <dc:date>2014-03-11T19:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for uri path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182444#M52578</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search | regex "\s/[^ ]+/[^ ]+/[^ ]+/"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 19:59:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182444#M52578</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-03-11T19:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for uri path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182445#M52579</link>
      <description>&lt;P&gt;How would I extract the path out to a variable to chart it? For example the top used paths using "top limit=2 uri_path"&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 20:10:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182445#M52579</guid>
      <dc:creator>loadtest</dc:creator>
      <dc:date>2014-03-11T20:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for uri path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182446#M52580</link>
      <description>&lt;P&gt;You can try rex:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search | rex "^.*\s(?P&amp;lt;uri_path&amp;gt;/[^ ]+/[^ ]+/[^ ]+/)\S"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;That should pull out a uri_path field that can be used for statistics or charting.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 21:32:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182446#M52580</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-03-11T21:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for uri path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182447#M52581</link>
      <description>&lt;P&gt;For the weblogs, I just used the inline field extractor with some small changes to extract the uriPath from the uri field that was imported from the AWS ELB logs I received. The main issue is some URIs have query fields (?key=value) and some do not. This has worked for me so far.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;rex field=uri "(?i)^(?:[^/]*/){3}(?P&amp;lt;uriPath&amp;gt;[^(\?|\s)]+)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If I make any more changes, I will update the rex.&lt;/P&gt;

&lt;P&gt;Also you can check out the URL Parser app in the Splunk App Store. Just take note that it has errors in the code that have to be corrected. They are noted &lt;A href="http://answers.splunk.com/answers/108728/faup-lookup-not-working-as-expected"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2014 08:44:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-uri-path/m-p/182447#M52581</guid>
      <dc:creator>ianathompson</dc:creator>
      <dc:date>2014-08-28T08:44:06Z</dc:date>
    </item>
  </channel>
</rss>

