<?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: group certain URLs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/group-certain-URLs/m-p/504845#M140994</link>
    <description>&lt;P&gt;You can normalize the url with regular expression, but you will need to account for all of your use cases.&amp;nbsp; Here's an example regex based on the examples you provided:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| rex mode=sed field=URL "s/\/(customer|savedsearch)\/[^\e\/]+/\/\1\//g"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a run anywhere example that shows how it works:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| makeresults
| eval URL="/login/
/login/
/api/customer/5542-a44/data
/api/customer/5c77-59w/data
/api/customer/7a88-134/data
/weather/forecast/
/api/savedsearch/7775
/api/savedsearch/4788
/new/use"
| makemv URL tokenizer="(?&amp;lt;URL&amp;gt;[^\n]+)"
| mvexpand URL
| rex mode=sed field=URL "s/\/(customer|savedsearch)\/[^\e\/]+/\/\1\//g"
| stats count by URL&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 17 Jun 2020 17:46:09 GMT</pubDate>
    <dc:creator>dmarling</dc:creator>
    <dc:date>2020-06-17T17:46:09Z</dc:date>
    <item>
      <title>group certain URLs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-certain-URLs/m-p/504834#M140992</link>
      <description>&lt;P&gt;I have a search that returns events with many different URLs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test URL=*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to obtain a count of events per URL&lt;/P&gt;&lt;P&gt;However some of the URLs are slightly different so I want to group them together&lt;/P&gt;&lt;P&gt;Example of my URL values&lt;/P&gt;&lt;P&gt;/login/&lt;BR /&gt;/login/&lt;BR /&gt;/api/customer/5542-a44/data&lt;BR /&gt;/api/customer/5c77-59w/data&lt;BR /&gt;/api/customer/7a88-134/data&lt;BR /&gt;/weather/forecast/&lt;BR /&gt;/api/savedseach/7775&lt;BR /&gt;/api/savedseach/4788&lt;BR /&gt;/new/user&lt;/P&gt;&lt;P&gt;What I would like to end up with&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;URL&lt;/TD&gt;&lt;TD&gt;COUNT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;/login/&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;/api/customer//data&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;P&gt;/weather/forecast/&lt;/P&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;/api/savedseach/&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;/new/user&lt;/P&gt;&lt;/TD&gt;&lt;TD&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;Im using | stats count by URL&lt;BR /&gt;However as mentioned above my issue is with the URLs that have ids or guids in them&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 17:07:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-certain-URLs/m-p/504834#M140992</guid>
      <dc:creator>gerard11</dc:creator>
      <dc:date>2020-06-17T17:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: group certain URLs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-certain-URLs/m-p/504845#M140994</link>
      <description>&lt;P&gt;You can normalize the url with regular expression, but you will need to account for all of your use cases.&amp;nbsp; Here's an example regex based on the examples you provided:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| rex mode=sed field=URL "s/\/(customer|savedsearch)\/[^\e\/]+/\/\1\//g"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a run anywhere example that shows how it works:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| makeresults
| eval URL="/login/
/login/
/api/customer/5542-a44/data
/api/customer/5c77-59w/data
/api/customer/7a88-134/data
/weather/forecast/
/api/savedsearch/7775
/api/savedsearch/4788
/new/use"
| makemv URL tokenizer="(?&amp;lt;URL&amp;gt;[^\n]+)"
| mvexpand URL
| rex mode=sed field=URL "s/\/(customer|savedsearch)\/[^\e\/]+/\/\1\//g"
| stats count by URL&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 Jun 2020 17:46:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-certain-URLs/m-p/504845#M140994</guid>
      <dc:creator>dmarling</dc:creator>
      <dc:date>2020-06-17T17:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: group certain URLs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/group-certain-URLs/m-p/504847#M141004</link>
      <description>&lt;P&gt;This is exactly what I was looking for, thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 18:14:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/group-certain-URLs/m-p/504847#M141004</guid>
      <dc:creator>gerard11</dc:creator>
      <dc:date>2020-06-17T18:14:35Z</dc:date>
    </item>
  </channel>
</rss>

