<?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: How to count stats by grouping substring from an URI in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-stats-by-grouping-substring-from-an-URI/m-p/483724#M135423</link>
    <description>&lt;P&gt;Try this &lt;BR /&gt;
&lt;CODE&gt;index=app sourcetype=access context=PL uri=/PL/data/2.0/space/*&lt;BR /&gt;
| rex field=uri "/PL/data/2.0/space/(?&amp;lt; APP&amp;gt;[^/]+)/(?&amp;lt; Request&amp;gt;[^\s]+)" &lt;BR /&gt;
| table App Request &lt;BR /&gt;
| stats count by APP&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2019 17:03:00 GMT</pubDate>
    <dc:creator>Anantha123</dc:creator>
    <dc:date>2019-09-18T17:03:00Z</dc:date>
    <item>
      <title>How to count stats by grouping substring from an URI</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-stats-by-grouping-substring-from-an-URI/m-p/483723#M135422</link>
      <description>&lt;P&gt;Here is my search:&lt;BR /&gt;
   &lt;CODE&gt;index=app sourcetype=access context=PL uri=/PL/data/2.0/space/*&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and I have the following logs in my search:&lt;BR /&gt;
   &lt;CODE&gt;/PL/data/2.0/space/appA/29323820jdd3723.txt&lt;/CODE&gt;&lt;BR /&gt;
   &lt;CODE&gt;/PL/data/2.0/space/appA/search/373367672djbd&lt;/CODE&gt;&lt;BR /&gt;
   &lt;CODE&gt;/PL/data/2.0/space/appB/abcdefsfjdf.pdf&lt;/CODE&gt;&lt;BR /&gt;
   &lt;CODE&gt;/PL/data/2.0/space/appB/get/9668568696&lt;/CODE&gt;&lt;BR /&gt;
   &lt;CODE&gt;/PL/data/2.0/space/appC/search/9650865686rt&lt;/CODE&gt;&lt;BR /&gt;
   &lt;CODE&gt;/PL/data/2.0/space/appD/6384387498374.jpg&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Now, I want the stats count results like below:&lt;BR /&gt;
&lt;STRONG&gt;appA   2&lt;BR /&gt;
appB   2&lt;BR /&gt;
appC   1&lt;BR /&gt;
appD   1&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 15:44:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-stats-by-grouping-substring-from-an-URI/m-p/483723#M135422</guid>
      <dc:creator>prakashpnvs</dc:creator>
      <dc:date>2019-09-18T15:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to count stats by grouping substring from an URI</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-stats-by-grouping-substring-from-an-URI/m-p/483724#M135423</link>
      <description>&lt;P&gt;Try this &lt;BR /&gt;
&lt;CODE&gt;index=app sourcetype=access context=PL uri=/PL/data/2.0/space/*&lt;BR /&gt;
| rex field=uri "/PL/data/2.0/space/(?&amp;lt; APP&amp;gt;[^/]+)/(?&amp;lt; Request&amp;gt;[^\s]+)" &lt;BR /&gt;
| table App Request &lt;BR /&gt;
| stats count by APP&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 17:03:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-stats-by-grouping-substring-from-an-URI/m-p/483724#M135423</guid>
      <dc:creator>Anantha123</dc:creator>
      <dc:date>2019-09-18T17:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to count stats by grouping substring from an URI</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-stats-by-grouping-substring-from-an-URI/m-p/483725#M135424</link>
      <description>&lt;P&gt;Executed this in Splunk UI and got the results in Visualization tab&lt;BR /&gt;
  &lt;CODE&gt;index=app sourcetype=access context=PL uri=/PL/data/2.0/space/* | rex field=uri "/PL/data/2.0/space/(?&amp;lt; APP&amp;gt;[^/]+)/(?&amp;lt; Request&amp;gt;[^\s]+)" | stats count by APP&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;also sorted it by ..... | sort - count&lt;/P&gt;

&lt;P&gt;Thanks much!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 17:41:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-stats-by-grouping-substring-from-an-URI/m-p/483725#M135424</guid>
      <dc:creator>prakashpnvs</dc:creator>
      <dc:date>2019-09-18T17:41:32Z</dc:date>
    </item>
  </channel>
</rss>

