<?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 How to create a drop-down to show counter information based on host? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-drop-down-to-show-counter-information-based-on/m-p/213604#M62659</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;Need help with my XML below. I need to create a drop-down to display certain data based on the host and counter fields.&lt;/P&gt;

&lt;P&gt;I can't figure out how to make the drop-down display the Avg. Disk sec/Transfer and Avg. Disk Bytes/Transfer for a host when selected on the same dashboard, even though the search works properly when running as a report. My search question is how do I create the search to display the Avg. Disk sec/Transfer and Avg. Disk Bytes/Transfer for a selected host on the drop-down?&lt;/P&gt;

&lt;P&gt;code Here:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;DEMO &amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="true"&amp;gt;
    &amp;lt;input type="dropdown" token="host" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Host&amp;lt;/label&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| metadata type=hosts index=* | table host&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-4h@m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;host&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;host&amp;lt;/fieldForValue&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="time" token="disk"&amp;gt;
      &amp;lt;label&amp;gt;select time&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-4h@m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt; IOPS Latency&amp;lt;/title&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=perfmon counter="Avg. Disk sec/Transfer"  Host="*" collection=LogicalDisk earliest=-1m [search index=perfmon counter="*"  Host="*"   collection=LogicalDisk earliest=-1m | stats max(Value) as latency by host | sort 10 -Value | fields host ]  | eval dataValue= "avg disk sec/transfer:" + tostring(round(Value,3)*1000)  | makemv delim="," allowempty=true dataValue  | mvexpand dataValue  | eval part=split(dataValue,":")  | eval category = Host + ":" + mvindex(part,0)  | eval dataPoint = tonumber(mvindex(part,1))  | timechart span=1s latest(dataPoint) by category
&amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 03 Sep 2015 17:19:42 GMT</pubDate>
    <dc:creator>idab</dc:creator>
    <dc:date>2015-09-03T17:19:42Z</dc:date>
    <item>
      <title>How to create a drop-down to show counter information based on host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-drop-down-to-show-counter-information-based-on/m-p/213604#M62659</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;Need help with my XML below. I need to create a drop-down to display certain data based on the host and counter fields.&lt;/P&gt;

&lt;P&gt;I can't figure out how to make the drop-down display the Avg. Disk sec/Transfer and Avg. Disk Bytes/Transfer for a host when selected on the same dashboard, even though the search works properly when running as a report. My search question is how do I create the search to display the Avg. Disk sec/Transfer and Avg. Disk Bytes/Transfer for a selected host on the drop-down?&lt;/P&gt;

&lt;P&gt;code Here:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;DEMO &amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="true"&amp;gt;
    &amp;lt;input type="dropdown" token="host" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Host&amp;lt;/label&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| metadata type=hosts index=* | table host&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-4h@m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;host&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;host&amp;lt;/fieldForValue&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="time" token="disk"&amp;gt;
      &amp;lt;label&amp;gt;select time&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-4h@m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt; IOPS Latency&amp;lt;/title&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=perfmon counter="Avg. Disk sec/Transfer"  Host="*" collection=LogicalDisk earliest=-1m [search index=perfmon counter="*"  Host="*"   collection=LogicalDisk earliest=-1m | stats max(Value) as latency by host | sort 10 -Value | fields host ]  | eval dataValue= "avg disk sec/transfer:" + tostring(round(Value,3)*1000)  | makemv delim="," allowempty=true dataValue  | mvexpand dataValue  | eval part=split(dataValue,":")  | eval category = Host + ":" + mvindex(part,0)  | eval dataPoint = tonumber(mvindex(part,1))  | timechart span=1s latest(dataPoint) by category
&amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Sep 2015 17:19:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-drop-down-to-show-counter-information-based-on/m-p/213604#M62659</guid>
      <dc:creator>idab</dc:creator>
      <dc:date>2015-09-03T17:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a drop-down to show counter information based on host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-drop-down-to-show-counter-information-based-on/m-p/213605#M62660</link>
      <description>&lt;P&gt;It seems you have'nt used the token for the host selected in your search string .&lt;/P&gt;

&lt;P&gt;use --Host="$host$" --instead of Host="*" ,throughout both the search strings.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2015 18:48:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-drop-down-to-show-counter-information-based-on/m-p/213605#M62660</guid>
      <dc:creator>jensonthottian</dc:creator>
      <dc:date>2015-09-03T18:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a drop-down to show counter information based on host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-drop-down-to-show-counter-information-based-on/m-p/213606#M62661</link>
      <description>&lt;P&gt;Thanks jensothian. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2015 21:18:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-drop-down-to-show-counter-information-based-on/m-p/213606#M62661</guid>
      <dc:creator>idab</dc:creator>
      <dc:date>2015-09-03T21:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a drop-down to show counter information based on host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-drop-down-to-show-counter-information-based-on/m-p/213607#M62662</link>
      <description>&lt;P&gt;If this has resolved your issue, do remember to accept the answer by clicking on the tick mark Accept button/link below the answer.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2015 18:47:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-drop-down-to-show-counter-information-based-on/m-p/213607#M62662</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-09-04T18:47:55Z</dc:date>
    </item>
  </channel>
</rss>

