<?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: Grouping HTTP GET requests based on first directory in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571322#M199089</link>
    <description>&lt;P&gt;Thank you for this solution!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Oct 2021 12:04:59 GMT</pubDate>
    <dc:creator>JaredYong</dc:creator>
    <dc:date>2021-10-18T12:04:59Z</dc:date>
    <item>
      <title>Grouping HTTP GET requests based on first directory</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571294#M199069</link>
      <description>&lt;P&gt;Very new to splunk here. I would like to group each http request to each directory based on their directory, and produce a count for each and plot it in a pie chart.&lt;/P&gt;&lt;P&gt;GET /vendor,&amp;nbsp;GET /Services,&amp;nbsp;GET /config,&amp;nbsp;GET /About&lt;/P&gt;&lt;P&gt;For example GET /vendor/vendor/auth/signin&amp;nbsp; and GET /vendor/vendor/browse should be classified under /vendor in a table.&lt;/P&gt;&lt;P&gt;my current query is wrong and doesn't show anything, modified it based on a GIAC paper.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;index="apache_logs" | stats count by request | eval request=case(&lt;BR /&gt;request="GET /config*", "/config",&lt;BR /&gt;request="GET /vendor*", "/vendor",&lt;BR /&gt;request="GET /Services*", "/Services",&lt;BR /&gt;request="GET /About*", "/About")&lt;BR /&gt;request="GET /about*", "/about")&lt;BR /&gt;| top request limit=0 useother=f&lt;BR /&gt;| eval request=request." (".count." events, ".round(percent,2)."%)"&lt;BR /&gt;&lt;BR /&gt;I would also like to differentiate requests to /about and /About&amp;nbsp;&lt;BR /&gt;&amp;nbsp;I hope this made sense.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 10:40:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571294#M199069</guid>
      <dc:creator>JaredYong</dc:creator>
      <dc:date>2021-10-18T10:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping HTTP GET requests based on first directory</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571298#M199072</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/239786"&gt;@JaredYong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can't give you a final query, however you can try using the combination of field extraction of /directory/ and stats it.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_base_query&amp;gt; "GET"
| rex field=request "\/(?&amp;lt;dir&amp;gt;\w+)\/" 
| stats count by dir&lt;/LI-CODE&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;An upvote would be appreciated if this reply helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 10:26:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571298#M199072</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-10-18T10:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping HTTP GET requests based on first directory</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571301#M199074</link>
      <description>&lt;LI-CODE lang="markup"&gt;index="apache_logs" 
| stats count by request 
| eval request=split(request,"/")
| eval request="/".mvindex(request,1)
| top request limit=0 useother=f
| eval request=request." (".count." events, ".round(percent,2)."%)"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 18 Oct 2021 10:32:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571301#M199074</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-18T10:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping HTTP GET requests based on first directory</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571321#M199088</link>
      <description>&lt;P&gt;Hi I have tried your solution, but it seems like its all categorized under /backend in the result, showing 30 events, while i should have 133 events. upon closer inspection, I noticed that each of the 30 events have their own count, which adds up to 133. How should I modify the solution such that it shows 133 instead of 30?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JaredYong_0-1634558225419.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16462i2E370E508EF25931/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JaredYong_0-1634558225419.png" alt="JaredYong_0-1634558225419.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 11:58:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571321#M199088</guid>
      <dc:creator>JaredYong</dc:creator>
      <dc:date>2021-10-18T11:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping HTTP GET requests based on first directory</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571322#M199089</link>
      <description>&lt;P&gt;Thank you for this solution!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 12:04:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571322#M199089</guid>
      <dc:creator>JaredYong</dc:creator>
      <dc:date>2021-10-18T12:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping HTTP GET requests based on first directory</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571325#M199092</link>
      <description>&lt;P&gt;one slight problem though, i am unable to put in the percentage for the pie chart, am i missing something here?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 12:08:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571325#M199092</guid>
      <dc:creator>JaredYong</dc:creator>
      <dc:date>2021-10-18T12:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping HTTP GET requests based on first directory</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571327#M199094</link>
      <description>&lt;P&gt;Change the order of the commands so that the directory is resolved before the counting&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="apache_logs" 
| eval request=split(request,"/")
| eval request="/".mvindex(request,1)
| stats count by request 
| top request limit=0 useother=f
| eval request=request." (".count." events, ".round(percent,2)."%)"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 18 Oct 2021 12:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571327#M199094</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-18T12:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping HTTP GET requests based on first directory</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571429#M199128</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/239786"&gt;@JaredYong&lt;/a&gt;&amp;nbsp; Are you good with pie chart?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 23:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Grouping-HTTP-GET-requests-based-on-first-directory/m-p/571429#M199128</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-10-18T23:26:32Z</dc:date>
    </item>
  </channel>
</rss>

