<?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 do I group similar URLs into one event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-group-similar-URLs-into-one-event/m-p/284519#M86054</link>
    <description>&lt;P&gt;I am doing a search to get the total count of different URIs and their response times. My result has multiple events of similar URLs -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Like /abc/{id1}/xyz;  
/abc/{id2}/xyz
/abc/{id3}/xyz.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Only the &lt;CODE&gt;{id}&lt;/CODE&gt; in the URL varies, and the rest of the URI portion is same. &lt;/P&gt;

&lt;P&gt;How can I group these events as 1 event, and still get the total count of hits to this URI?&lt;/P&gt;

&lt;P&gt;This is my search -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=stuff RelativeURI="/abc/*/xyz"  |stats count as total_call_count, avg(ResponseTime) as avgResponse by RelativeURI
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Sep 2016 15:49:42 GMT</pubDate>
    <dc:creator>deeps1984</dc:creator>
    <dc:date>2016-09-14T15:49:42Z</dc:date>
    <item>
      <title>How do I group similar URLs into one event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-group-similar-URLs-into-one-event/m-p/284519#M86054</link>
      <description>&lt;P&gt;I am doing a search to get the total count of different URIs and their response times. My result has multiple events of similar URLs -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Like /abc/{id1}/xyz;  
/abc/{id2}/xyz
/abc/{id3}/xyz.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Only the &lt;CODE&gt;{id}&lt;/CODE&gt; in the URL varies, and the rest of the URI portion is same. &lt;/P&gt;

&lt;P&gt;How can I group these events as 1 event, and still get the total count of hits to this URI?&lt;/P&gt;

&lt;P&gt;This is my search -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=stuff RelativeURI="/abc/*/xyz"  |stats count as total_call_count, avg(ResponseTime) as avgResponse by RelativeURI
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 15:49:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-group-similar-URLs-into-one-event/m-p/284519#M86054</guid>
      <dc:creator>deeps1984</dc:creator>
      <dc:date>2016-09-14T15:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I group similar URLs into one event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-group-similar-URLs-into-one-event/m-p/284520#M86055</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=stuff RelativeURI="/abc/*/xyz" | eval RelativeURI =replace(RelativeURI ,"^(\/[^\/]+\/)([^\/]+)(\/[^\/]+)","\1XXX\3") |stats count as total_call_count, avg(ResponseTime) as avgResponse by RelativeURI
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 16:11:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-group-similar-URLs-into-one-event/m-p/284520#M86055</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-14T16:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I group similar URLs into one event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-group-similar-URLs-into-one-event/m-p/284521#M86056</link>
      <description>&lt;P&gt;On second thought, if you're hardcoding the URL (format at least) in the base search, why not just remove the by clause from stats. That will give you total count and average for all matching URI's. Like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=stuff RelativeURI="/abc/*/xyz" |stats count as total_call_count, avg(ResponseTime) as avgResponse | eval RelativeURI="/abc/*/xyz" | table RelativeURI total_call_count avgResponse 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 16:13:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-group-similar-URLs-into-one-event/m-p/284521#M86056</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-14T16:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I group similar URLs into one event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-group-similar-URLs-into-one-event/m-p/284522#M86057</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=stuff RelativeURI="/abc/*/xyz" | rex field=RelativeURI "(?&amp;lt;url1&amp;gt;\/\S+\/)\S+\/(?&amp;lt;url2&amp;gt;\S+)" | eval url=url1.url2 | stats count as total_call_count, avg(ResponseTime) as avgResponse by url
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 16:16:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-group-similar-URLs-into-one-event/m-p/284522#M86057</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-14T16:16:09Z</dc:date>
    </item>
  </channel>
</rss>

