<?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 In a stats based on the item selected in the drop down, how can I display two columns in the panel which display the count when Id=* and when Id=number? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/In-a-stats-based-on-the-item-selected-in-the-drop-down-how-can-I/m-p/302325#M90974</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a query which does the stats count by ID selected through the drop-down query looks like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=servers sourcetype=json Id=* msg="method" OR "disabled" earliest=-60m@m latest=now  | stats count as cnt by _time,msg, Id | head limit=20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to display two columns in the panel which display the count when Id=* and when Id=number respectively. Where a number can be any choice from the drop-down.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2018 21:59:56 GMT</pubDate>
    <dc:creator>macadminrohit</dc:creator>
    <dc:date>2018-02-20T21:59:56Z</dc:date>
    <item>
      <title>In a stats based on the item selected in the drop down, how can I display two columns in the panel which display the count when Id=* and when Id=number?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-stats-based-on-the-item-selected-in-the-drop-down-how-can-I/m-p/302325#M90974</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a query which does the stats count by ID selected through the drop-down query looks like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=servers sourcetype=json Id=* msg="method" OR "disabled" earliest=-60m@m latest=now  | stats count as cnt by _time,msg, Id | head limit=20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to display two columns in the panel which display the count when Id=* and when Id=number respectively. Where a number can be any choice from the drop-down.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 21:59:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-stats-based-on-the-item-selected-in-the-drop-down-how-can-I/m-p/302325#M90974</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-02-20T21:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: In a stats based on the item selected in the drop down, how can I display two columns in the panel which display the count when Id=* and when Id=number?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-stats-based-on-the-item-selected-in-the-drop-down-how-can-I/m-p/302326#M90975</link>
      <description>&lt;P&gt;Assuming you're using the Id dropdown token as &lt;CODE&gt;$id$&lt;/CODE&gt; in the base search, try like this. This will show &lt;CODE&gt;id=*&lt;/CODE&gt;on all rows if the Id selected from dropdown was &lt;CODE&gt;*&lt;/CODE&gt; (all Ids) ,will show Id=selectedId otherwise.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=servers sourcetype=json Id="$id$" msg="method" OR "disabled" earliest=-60m@m latest=now | eval Id=if("$id$"="*","*",id) | stats count as cnt by _time,msg, Id | head limit=20
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Feb 2018 22:12:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-stats-based-on-the-item-selected-in-the-drop-down-how-can-I/m-p/302326#M90975</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-20T22:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: In a stats based on the item selected in the drop down, how can I display two columns in the panel which display the count when Id=* and when Id=number?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-stats-based-on-the-item-selected-in-the-drop-down-how-can-I/m-p/302327#M90976</link>
      <description>&lt;P&gt;Thanks, I was thinking to do the same thing but it is displaying * under the column Id.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 01:22:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-stats-based-on-the-item-selected-in-the-drop-down-how-can-I/m-p/302327#M90976</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-02-21T01:22:33Z</dc:date>
    </item>
  </channel>
</rss>

