<?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: URL aggregation in splunk query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747591#M241850</link>
    <description>&lt;P&gt;You might simply cut the prefix from your URI. Something like this&lt;/P&gt;&lt;PRE&gt;| rex mode=sed field=uri "s/^\\/\S+((arabic|english)\\/)?//"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;'s pooint about /experience/ part is also valid. But searching for */experience/* is not a best idea (search terms with wildcards at the beginning are usually best avoided).&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jun 2025 21:33:01 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2025-06-05T21:33:01Z</dc:date>
    <item>
      <title>URL aggregation in splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747518#M241834</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;Below is my splunk query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"  uri="*/experience/*"
| stats count as hits by uri
| sort -hits
| head 20&lt;/LI-CODE&gt;&lt;P&gt;which returns me the output as below&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;/ae/english/experience/dining/onboard-menu/&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;/ae/english/experience/woyf/&lt;/TD&gt;&lt;TD height="25px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;/uk/english/experience/dining/onboard-menu/&lt;/TD&gt;&lt;TD height="25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;/us/english/experience/dining/onboard-menu/&lt;/TD&gt;&lt;TD height="25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;/ae/arabic/experience/dining/onboard-menu/&lt;/TD&gt;&lt;TD height="25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;/english/experience/dining/onboard-menu/&lt;/TD&gt;&lt;TD height="25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to aggregate the url count into common url. For example:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;/experience/dining/onboard-menu/&lt;/TD&gt;&lt;TD width="50%"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;/experience/woyf/&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help on this.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 03:19:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747518#M241834</guid>
      <dc:creator>super_edition</dc:creator>
      <dc:date>2025-06-05T03:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: URL aggregation in splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747521#M241835</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253204"&gt;@super_edition&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| makeresults &lt;BR /&gt;| eval data="/ae/english/experience/dining/onboard-menu/=1;/ae/english/experience/woyf/=2;/uk/english/experience/dining/onboard-menu/=1;/us/english/experience/dining/onboard-menu/=1;/ae/arabic/experience/dining/onboard-menu/=1;/english/experience/dining/onboard-menu/=1" &lt;BR /&gt;| makemv delim=";" data &lt;BR /&gt;| mvexpand data &lt;BR /&gt;| rex field=data "(?&amp;lt;uri&amp;gt;[^=]+)=(?&amp;lt;count&amp;gt;\d+)" &lt;BR /&gt;| eval count=tonumber(count)&lt;BR /&gt;| eval normalized_uri = replace(uri, "^/[^/]+/[^/]+", "") &lt;BR /&gt;| stats sum(count) as hits by normalized_uri&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kiran_panchavat_0-1749104577462.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/39302i1DF0FE14BDDAA721/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kiran_panchavat_0-1749104577462.png" alt="kiran_panchavat_0-1749104577462.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:23:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747521#M241835</guid>
      <dc:creator>kiran_panchavat</dc:creator>
      <dc:date>2025-06-05T06:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: URL aggregation in splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747523#M241836</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253204"&gt;@super_edition&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simple REX command to split out should hopefully work well here:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=url "(?&amp;lt;commonUrl&amp;gt;\/experience\/.*)\/?"
| stats count by commonUrl&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1749104862246.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/39303i5C3B080AC0780BDB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1749104862246.png" alt="livehybrid_0-1749104862246.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Full example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults count=2
| streamstats count
| eval url=case(count==1,"/us/english/experience/dining/onboard-menu/",count==2,"/ae/english/experience/dining/onboard-menu/")
| rex field=url "(?&amp;lt;commonUrl&amp;gt;\/experience\/.*)\/?"
| stats count by commonUrl&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:27:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747523#M241836</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-06-05T06:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: URL aggregation in splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747556#M241839</link>
      <description>&lt;P&gt;But what constitutes those as "common"? As long as you can answer this question, adjusting your results will be relatively easy.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 10:06:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747556#M241839</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-06-05T10:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: URL aggregation in splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747566#M241843</link>
      <description>&lt;P&gt;&lt;SPAN&gt;what constitutes those as "common"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The onboard-menu url hits same service.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Its only accessed from different "markets" which are:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/ae/english ,&amp;nbsp;/uk/english ,&amp;nbsp;/us/english ,&amp;nbsp;/ae/arabic and /english&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;like that we will have multiple markets starts &lt;EM&gt;/country_code/english or arabic/&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 14:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747566#M241843</guid>
      <dc:creator>super_edition</dc:creator>
      <dc:date>2025-06-05T14:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: URL aggregation in splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747574#M241845</link>
      <description>&lt;P&gt;Do you know your application path always starts with &lt;FONT face="andale mono,times"&gt;/experience&lt;/FONT&gt;? &amp;nbsp;If so,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;'s method should work, just replace url with uri.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"  uri="*/experience/*"
| rex field=uri "(?&amp;lt;uniqueURI&amp;gt;/experience/.*)"
| stats count as hits by uniqueURI
| sort -hits
| head 20&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If not, you can enumerate, or use some other methods to determine the beginning of application path.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 15:26:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747574#M241845</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2025-06-05T15:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: URL aggregation in splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747591#M241850</link>
      <description>&lt;P&gt;You might simply cut the prefix from your URI. Something like this&lt;/P&gt;&lt;PRE&gt;| rex mode=sed field=uri "s/^\\/\S+((arabic|english)\\/)?//"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;'s pooint about /experience/ part is also valid. But searching for */experience/* is not a best idea (search terms with wildcards at the beginning are usually best avoided).&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 21:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747591#M241850</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-06-05T21:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: URL aggregation in splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747726#M241866</link>
      <description>&lt;P&gt;Thanks Everyone for your response. Highly Appreciate your input. I was able to construct the query something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"  uri="*/experience/*"
| eval common_uri = replace(uri, "^(/[^/]+){1,2}(/experience/.*)", "\2")
| stats count(common_uri) as hits by common_uri
| sort -hits
| head 20&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 10 Jun 2025 04:32:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/URL-aggregation-in-splunk-query/m-p/747726#M241866</guid>
      <dc:creator>super_edition</dc:creator>
      <dc:date>2025-06-10T04:32:16Z</dc:date>
    </item>
  </channel>
</rss>

