<?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: Calculate traffic split based on URI prefix in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109302#M28507</link>
    <description>&lt;P&gt;If this field is extracted try this.&lt;/P&gt;

&lt;P&gt;your base search | stats count by uri_path&lt;BR /&gt;
or&lt;BR /&gt;
your base search | chart count by uri_path&lt;/P&gt;

&lt;P&gt;and use pie chart as visualisation.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 16:14:54 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2020-09-28T16:14:54Z</dc:date>
    <item>
      <title>Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109301#M28506</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;The traffic in our application is routed according to a URI prefix, for example: &lt;CODE&gt;uri_path=/foo/*&lt;/CODE&gt; or &lt;CODE&gt;uri_path=/bar/*&lt;/CODE&gt;. How can I produce a pie chart that simply shows the percentage of traffic that went to each &lt;CODE&gt;uri_path&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 11:58:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109301#M28506</guid>
      <dc:creator>johntopley</dc:creator>
      <dc:date>2014-03-27T11:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109302#M28507</link>
      <description>&lt;P&gt;If this field is extracted try this.&lt;/P&gt;

&lt;P&gt;your base search | stats count by uri_path&lt;BR /&gt;
or&lt;BR /&gt;
your base search | chart count by uri_path&lt;/P&gt;

&lt;P&gt;and use pie chart as visualisation.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:14:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109302#M28507</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T16:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109303#M28508</link>
      <description>&lt;P&gt;Thanks, but uri_path contains numerous values. I need the grouping by uri_path prefix.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:14:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109303#M28508</guid>
      <dc:creator>johntopley</dc:creator>
      <dc:date>2020-09-28T16:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109304#M28509</link>
      <description>&lt;P&gt;Then (based on your example, your just need first part of uri, '/foo' and '/bar'), try this.&lt;/P&gt;

&lt;P&gt;your base search| rex field=uri_path "^(?&lt;URI_PREFIX&gt;.*)\/"| stats count by uri_prefix&lt;/URI_PREFIX&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:15:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109304#M28509</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T16:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109305#M28510</link>
      <description>&lt;P&gt;I don't think that does what I need. I'm expecting two figures: one for all uri_paths that start with /foo and another for all uri_paths that start with /bar.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:15:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109305#M28510</guid>
      <dc:creator>johntopley</dc:creator>
      <dc:date>2020-09-28T16:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109306#M28511</link>
      <description>&lt;P&gt;With the search "your base search| rex field=uri_path "^(?&lt;URI_PREFIX&gt;.*)/"", what values you're getting in the field uri_prefix?&lt;/URI_PREFIX&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:15:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109306#M28511</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T16:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109307#M28512</link>
      <description>&lt;P&gt;I get &amp;gt; 100 different values for the uri_prefix field. Lots of different URLs that start with /foo or /bar.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 15:14:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109307#M28512</guid>
      <dc:creator>johntopley</dc:creator>
      <dc:date>2014-03-27T15:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109308#M28513</link>
      <description>&lt;P&gt;It seems slashes were removed in the comment field. try this.&lt;/P&gt;

&lt;P&gt;your base search| rex field=uri_path "^/(?&lt;URI_PREFIX&gt;[^/]*)"| stats count by uri_prefix&lt;/URI_PREFIX&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:15:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109308#M28513</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T16:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109309#M28514</link>
      <description>&lt;P&gt;Thanks, but it still gives 100s of different values for uri_prefix instead of the two I want.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 15:43:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109309#M28514</guid>
      <dc:creator>johntopley</dc:creator>
      <dc:date>2014-03-27T15:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109310#M28515</link>
      <description>&lt;P&gt;Try the updated search '| rex field=uri_path "^/(?&lt;URI_PREFIX&gt;[^/]*)"'. This gives 'bar' and 'foo' from the uri.&lt;/URI_PREFIX&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:15:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109310#M28515</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T16:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109311#M28516</link>
      <description>&lt;P&gt;No, still the same.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2014 08:47:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109311#M28516</guid>
      <dc:creator>johntopley</dc:creator>
      <dc:date>2014-03-28T08:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109312#M28517</link>
      <description>&lt;P&gt;Hi johntopley,&lt;/P&gt;

&lt;P&gt;try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=uri_path max_match=0 "(?&amp;lt;uri_prefix&amp;gt;/[^/]+)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2014 09:02:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109312#M28517</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-28T09:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109313#M28518</link>
      <description>&lt;P&gt;Thanks, but it gives 100s of different values for uri_prefix instead of the two I want.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2014 10:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109313#M28518</guid>
      <dc:creator>johntopley</dc:creator>
      <dc:date>2014-03-28T10:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109314#M28519</link>
      <description>&lt;P&gt;how about this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your base search uri_path=/foo/* OR uri_path=/bar/*  | rex field=uri_path max_match=0 "(?&amp;lt;uri_prefix&amp;gt;/[^/]+)" | dedup uri_prefix | ...&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2014 10:45:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109314#M28519</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-28T10:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109315#M28520</link>
      <description>&lt;P&gt;It doesn't group the requests into those that start with &lt;CODE&gt;/foo/*&lt;/CODE&gt; and those that start with &lt;CODE&gt;/bar/*&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2014 11:13:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109315#M28520</guid>
      <dc:creator>johntopley</dc:creator>
      <dc:date>2014-03-28T11:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109316#M28521</link>
      <description>&lt;P&gt;sure it will not group anything, because there is no stats nor any other command which will do that. So if you take the updated search and add a stats to it will that match your needs?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your base search uri_path=/foo/* OR uri_path=/bar/*  | rex field=uri_path max_match=0 "(?&amp;lt;uri_prefix&amp;gt;/[^/]+)" |  stats count by uri_prefix&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I can only try to help and try to lead you, but I cannot write a complete search because I don't have your data....&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2014 12:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109316#M28521</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-28T12:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate traffic split based on URI prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109317#M28522</link>
      <description>&lt;P&gt;I have a similar situation and found MuS's proposed solution to point me in the right direction. I was getting multi-valued fields for my uri_prefix and discovered that &lt;CODE&gt;max_match=0&lt;/CODE&gt; seemed to be causing that. So, changing &lt;CODE&gt;max_match=1&lt;/CODE&gt; (the default) got me what I was looking for.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base_search | rex field=uri_path max_match=1 "(?&amp;lt;uri_prefix&amp;gt;/[^/]+)" | stats count by uri_prefix
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:10:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-traffic-split-based-on-URI-prefix/m-p/109317#M28522</guid>
      <dc:creator>jdgifford</dc:creator>
      <dc:date>2020-09-28T18:10:02Z</dc:date>
    </item>
  </channel>
</rss>

