<?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: Creating a Hierarchical Search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-Hierarchical-Search/m-p/750410#M242314</link>
    <description>&lt;P&gt;Try something like this (essentially, you need to calculate each "top 5" and eliminate the stats events for each level, before calculating the next "top 5" for the next level).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;action=load OR action=Download customer!="" publicationId="*" topic="*"
| eval Month=strftime(_time, "%b-%y")
| stats count by customer, Month, product, publicationId, topic
| eventstats sum(count) as product_count by customer Month product
| sort 0 customer Month -product_count
| streamstats dc(product) as product_rank by customer, Month
| where product_rank &amp;lt;= 5
| eventstats sum(count) as publicationId_count by customer Month product publicationId
| sort 0 customer Month product -publicationId_count
| streamstats dc(publicationId) as publicationId_rank by customer Month product
| where publicationId_rank &amp;lt;= 5
| eventstats sum(count) as topic_count by customer Month product publicationId topic
| sort 0 customer Month product publicationId -topic_count
| streamstats dc(topic) as topic_rank by customer Month product publicationId
| where topic_rank &amp;lt;= 5
| table customer, product, publicationId, topic, count, Month&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 24 Jul 2025 15:30:01 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2025-07-24T15:30:01Z</dc:date>
    <item>
      <title>Creating a Hierarchical Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-Hierarchical-Search/m-p/750402#M242309</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I have the following query with the provided fields to track consumption data for customers.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;action=load OR action=Download customer!="" publicationId="*" topic="*"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| eval Month=strftime(_time, "%b-%y")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| stats count by customer, Month, product, publicationId, topic&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| streamstats count as product_rank by customer, Month&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| where product_rank &amp;lt;= 5&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| table customer, product, publicationId, topic, count, Month&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;However, I do not believe it is achieving what I aim for. The data is structured as follows: Products &amp;gt; Publication IDs within those products &amp;gt; Topics within those specific publication IDs. What I am trying to accomplish is find out the top 5 products per customer per month, and then for each of those 5 products find out the top 5 publicationIds within them, and then for each publicationID find out the top 5 topics within them.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2025 13:34:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-Hierarchical-Search/m-p/750402#M242309</guid>
      <dc:creator>bp2025</dc:creator>
      <dc:date>2025-07-24T13:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Hierarchical Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-Hierarchical-Search/m-p/750410#M242314</link>
      <description>&lt;P&gt;Try something like this (essentially, you need to calculate each "top 5" and eliminate the stats events for each level, before calculating the next "top 5" for the next level).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;action=load OR action=Download customer!="" publicationId="*" topic="*"
| eval Month=strftime(_time, "%b-%y")
| stats count by customer, Month, product, publicationId, topic
| eventstats sum(count) as product_count by customer Month product
| sort 0 customer Month -product_count
| streamstats dc(product) as product_rank by customer, Month
| where product_rank &amp;lt;= 5
| eventstats sum(count) as publicationId_count by customer Month product publicationId
| sort 0 customer Month product -publicationId_count
| streamstats dc(publicationId) as publicationId_rank by customer Month product
| where publicationId_rank &amp;lt;= 5
| eventstats sum(count) as topic_count by customer Month product publicationId topic
| sort 0 customer Month product publicationId -topic_count
| streamstats dc(topic) as topic_rank by customer Month product publicationId
| where topic_rank &amp;lt;= 5
| table customer, product, publicationId, topic, count, Month&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 24 Jul 2025 15:30:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-Hierarchical-Search/m-p/750410#M242314</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-07-24T15:30:01Z</dc:date>
    </item>
  </channel>
</rss>

