<?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: Stats count by token value in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Stats-count-by-token-value/m-p/592845#M48635</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244668"&gt;@maned_beak&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you have three dropdowns:&amp;nbsp;&lt;SPAN&gt;Type,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;User and S&lt;/SPAN&gt;&lt;SPAN&gt;ite,&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;you want to choose the values on the three dropdowns and use them in a search,&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;then you want to choose the aggregation field using a fourth dropdown 8and a fourth token,&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;is this correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this is your need, you have to create a dashboard containing this four dropdowns:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="Type"&amp;gt;
      &amp;lt;label&amp;gt;Type&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;prefix&amp;gt;Type="&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;Type&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;Type&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;
          index=your_index
          | dedup Type
          | sort Type
          | table Type
          &amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;$Time.earliest$&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;$Time.latest$&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="User"&amp;gt;
      &amp;lt;label&amp;gt;User&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;prefix&amp;gt;User="&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;User&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;User&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;
          index=your_index
          | dedup User
          | sort User
          | table User
          &amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;$Time.earliest$&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;$Time.latest$&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="Site"&amp;gt;
      &amp;lt;label&amp;gt;Site&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;prefix&amp;gt;Site="&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;Site&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;Site&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;
          index=your_index
          | dedup Site
          | sort Site
          | table Site
          &amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;$Time.earliest$&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;$Time.latest$&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="radio" token="choice"&amp;gt;
      &amp;lt;label&amp;gt;Grouping choice&amp;lt;/label&amp;gt;
      &amp;lt;choice value="Type"&amp;gt;Type&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="User"&amp;gt;user&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Site"&amp;gt;Site&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
&amp;lt;/fieldset&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;then in the dashboard panel use a search like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index sourcetype=your_sourcetype $Type$ $User$ $Site$
| stats count by $choice$&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 07 Apr 2022 07:02:56 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-04-07T07:02:56Z</dc:date>
    <item>
      <title>How to create Stats count by token value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Stats-count-by-token-value/m-p/592791#M48630</link>
      <description>&lt;P&gt;Hello Splunkers&lt;BR /&gt;&lt;BR /&gt;I have a below query, that am trying to get a count by field values, I am working on creating a dynamic dashboard that I have the below three fields as three&amp;nbsp; dropdown inputs.&amp;nbsp;&lt;BR /&gt;So, How can I make the token dynamic here, like when I choose only one value from one of the three dropdown inputs that value should populate on the stats command token. Thanks in advance!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=&amp;lt;&amp;gt; sourcetype=&amp;lt;&amp;gt;
| search Type=$Token$
| search User=$Token$
| search Site=$Token$
| stats count by $Token$&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 07 Apr 2022 15:25:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Stats-count-by-token-value/m-p/592791#M48630</guid>
      <dc:creator>maned_beak</dc:creator>
      <dc:date>2022-04-07T15:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Stats count by token value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Stats-count-by-token-value/m-p/592844#M48634</link>
      <description>&lt;P&gt;If $Token$ holds the name of a field then the stats command would work although it seems unlikely that the searches using the same token value would result in any events being left.&lt;/P&gt;&lt;P&gt;The issue may be more to do with how you have defined the inputs/dropdowns for the tokens. Can you be more specific and show the SimpleXML code for these dropdowns?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 07:00:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Stats-count-by-token-value/m-p/592844#M48634</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-07T07:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Stats count by token value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Stats-count-by-token-value/m-p/592845#M48635</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244668"&gt;@maned_beak&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you have three dropdowns:&amp;nbsp;&lt;SPAN&gt;Type,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;User and S&lt;/SPAN&gt;&lt;SPAN&gt;ite,&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;you want to choose the values on the three dropdowns and use them in a search,&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;then you want to choose the aggregation field using a fourth dropdown 8and a fourth token,&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;is this correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this is your need, you have to create a dashboard containing this four dropdowns:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="Type"&amp;gt;
      &amp;lt;label&amp;gt;Type&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;prefix&amp;gt;Type="&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;Type&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;Type&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;
          index=your_index
          | dedup Type
          | sort Type
          | table Type
          &amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;$Time.earliest$&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;$Time.latest$&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="User"&amp;gt;
      &amp;lt;label&amp;gt;User&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;prefix&amp;gt;User="&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;User&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;User&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;
          index=your_index
          | dedup User
          | sort User
          | table User
          &amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;$Time.earliest$&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;$Time.latest$&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="Site"&amp;gt;
      &amp;lt;label&amp;gt;Site&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;prefix&amp;gt;Site="&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;Site&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;Site&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;
          index=your_index
          | dedup Site
          | sort Site
          | table Site
          &amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;$Time.earliest$&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;$Time.latest$&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="radio" token="choice"&amp;gt;
      &amp;lt;label&amp;gt;Grouping choice&amp;lt;/label&amp;gt;
      &amp;lt;choice value="Type"&amp;gt;Type&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="User"&amp;gt;user&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Site"&amp;gt;Site&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
&amp;lt;/fieldset&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;then in the dashboard panel use a search like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index sourcetype=your_sourcetype $Type$ $User$ $Site$
| stats count by $choice$&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 07:02:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-Stats-count-by-token-value/m-p/592845#M48635</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-07T07:02:56Z</dc:date>
    </item>
  </channel>
</rss>

