<?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 Can I perform stats count on a substring using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-perform-stats-count-on-a-substring-using-regex/m-p/367199#M108319</link>
    <description>&lt;P&gt;I have log events such as activity:&lt;A href="http://xyz/rest/876"&gt;http://xyz/rest/876&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://xyz/rest/223"&gt;http://xyz/rest/223&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://xyz/rest/263"&gt;http://xyz/rest/263&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://xyz/rest/4534"&gt;http://xyz/rest/4534&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://abc/rest/1"&gt;http://abc/rest/1&lt;/A&gt;&lt;BR /&gt;
when I do stats count by activity I want to get results as:&lt;BR /&gt;
&lt;A href="http://xyz/rest"&gt;http://xyz/rest&lt;/A&gt; 4&lt;BR /&gt;
&lt;A href="http://abc/rest"&gt;http://abc/rest&lt;/A&gt; 1&lt;/P&gt;

&lt;P&gt;How can it be best done?&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2017 02:30:31 GMT</pubDate>
    <dc:creator>chetan1974</dc:creator>
    <dc:date>2017-09-27T02:30:31Z</dc:date>
    <item>
      <title>Can I perform stats count on a substring using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-perform-stats-count-on-a-substring-using-regex/m-p/367199#M108319</link>
      <description>&lt;P&gt;I have log events such as activity:&lt;A href="http://xyz/rest/876"&gt;http://xyz/rest/876&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://xyz/rest/223"&gt;http://xyz/rest/223&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://xyz/rest/263"&gt;http://xyz/rest/263&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://xyz/rest/4534"&gt;http://xyz/rest/4534&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://abc/rest/1"&gt;http://abc/rest/1&lt;/A&gt;&lt;BR /&gt;
when I do stats count by activity I want to get results as:&lt;BR /&gt;
&lt;A href="http://xyz/rest"&gt;http://xyz/rest&lt;/A&gt; 4&lt;BR /&gt;
&lt;A href="http://abc/rest"&gt;http://abc/rest&lt;/A&gt; 1&lt;/P&gt;

&lt;P&gt;How can it be best done?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 02:30:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-perform-stats-count-on-a-substring-using-regex/m-p/367199#M108319</guid>
      <dc:creator>chetan1974</dc:creator>
      <dc:date>2017-09-27T02:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can I perform stats count on a substring using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-perform-stats-count-on-a-substring-using-regex/m-p/367200#M108320</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  rex "(?&amp;lt;activity&amp;gt;http:\/\/[^\/]*\/rest)" 
| stats count as mycount by activity
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Sep 2017 17:42:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-perform-stats-count-on-a-substring-using-regex/m-p/367200#M108320</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-09-27T17:42:39Z</dc:date>
    </item>
  </channel>
</rss>

