<?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: Need help with a dropdown... in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215492#M43397</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt; Dashboard &amp;gt; Click &lt;STRONG&gt;Add Input&lt;/STRONG&gt; &amp;gt; Choose &lt;STRONG&gt;Dropdown&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Edit Dropdown by clicking on &lt;STRONG&gt;Edit input&lt;/STRONG&gt; icon against field1. &lt;BR /&gt;
1) Rename &lt;STRONG&gt;Label&lt;/STRONG&gt; as &lt;STRONG&gt;Select Mail Server&lt;/STRONG&gt;. &lt;BR /&gt;
2) Check &lt;STRONG&gt;Search on Change&lt;/STRONG&gt; option.&lt;BR /&gt;
3) Select &lt;STRONG&gt;Token&lt;/STRONG&gt; = &lt;STRONG&gt;selMailServer&lt;/STRONG&gt;&lt;BR /&gt;
4) Scroll to &lt;STRONG&gt;Static Options&lt;/STRONG&gt; and add the following &lt;STRONG&gt;Name&lt;/STRONG&gt; - &lt;STRONG&gt;Values&lt;/STRONG&gt; :&lt;BR /&gt;
Name= &lt;STRONG&gt;01&lt;/STRONG&gt; -- Value=&lt;STRONG&gt;mailserver-01&lt;/STRONG&gt;&lt;BR /&gt;
             &lt;STRONG&gt;02&lt;/STRONG&gt; -- &lt;STRONG&gt;mailserver-02&lt;/STRONG&gt;&lt;BR /&gt;
              ...&lt;BR /&gt;
             &lt;STRONG&gt;10&lt;/STRONG&gt; -- &lt;STRONG&gt;mailserver-10&lt;/STRONG&gt;&lt;BR /&gt;
4) Scroll back to &lt;STRONG&gt;Default&lt;/STRONG&gt; field an choose &lt;STRONG&gt;01&lt;/STRONG&gt; as the default field value.&lt;/P&gt;

&lt;P&gt;PS: You can define lookup tables for more dynamic list and values and use Dynamic Options to populate Name/Value through Splunk Search String.&lt;/P&gt;

&lt;P&gt;Following is the Simple XML Source Code for the same (Notice root node changes from dashboard to form the moment we add any form inputs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fieldset&amp;gt;
  &amp;lt;input type="dropdown" token="selMailServer" searchWhenChanged="true"&amp;gt;
    &amp;lt;label&amp;gt;Select Mail Server&amp;lt;/label&amp;gt;
    &amp;lt;choice value="mailserver-01"&amp;gt;01&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-02"&amp;gt;02&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-03"&amp;gt;03&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-04"&amp;gt;04&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-05"&amp;gt;05&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-06"&amp;gt;06&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-07"&amp;gt;07&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-08"&amp;gt;08&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-09"&amp;gt;09&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-10"&amp;gt;10&amp;lt;/choice&amp;gt;
    &amp;lt;default&amp;gt;mailserver-01&amp;lt;/default&amp;gt;
  &amp;lt;/input&amp;gt;
&amp;lt;/fieldset&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;5) Finally, in your search you can replace &lt;STRONG&gt;mailserver-01&lt;/STRONG&gt; with &lt;STRONG&gt;$selMailServer$&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Nov 2016 12:03:05 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2016-11-09T12:03:05Z</dc:date>
    <item>
      <title>Need help with a dropdown...</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215491#M43396</link>
      <description>&lt;P&gt;I have the following Splunk query:&lt;/P&gt;

&lt;P&gt;sourcetype=api "analyzed email count" &lt;STRONG&gt;mailserver-01&lt;/STRONG&gt; | stats sum(mail_value) AS "Total".&lt;/P&gt;

&lt;P&gt;mailserver-01 is a field in Splunk that defines the mail server.  I have 10 mailservers and wanted to make an dropdown list where users can select the mailserver and the dash will auto refresh.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 09:30:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215491#M43396</guid>
      <dc:creator>balleste</dc:creator>
      <dc:date>2016-11-09T09:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a dropdown...</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215492#M43397</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt; Dashboard &amp;gt; Click &lt;STRONG&gt;Add Input&lt;/STRONG&gt; &amp;gt; Choose &lt;STRONG&gt;Dropdown&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Edit Dropdown by clicking on &lt;STRONG&gt;Edit input&lt;/STRONG&gt; icon against field1. &lt;BR /&gt;
1) Rename &lt;STRONG&gt;Label&lt;/STRONG&gt; as &lt;STRONG&gt;Select Mail Server&lt;/STRONG&gt;. &lt;BR /&gt;
2) Check &lt;STRONG&gt;Search on Change&lt;/STRONG&gt; option.&lt;BR /&gt;
3) Select &lt;STRONG&gt;Token&lt;/STRONG&gt; = &lt;STRONG&gt;selMailServer&lt;/STRONG&gt;&lt;BR /&gt;
4) Scroll to &lt;STRONG&gt;Static Options&lt;/STRONG&gt; and add the following &lt;STRONG&gt;Name&lt;/STRONG&gt; - &lt;STRONG&gt;Values&lt;/STRONG&gt; :&lt;BR /&gt;
Name= &lt;STRONG&gt;01&lt;/STRONG&gt; -- Value=&lt;STRONG&gt;mailserver-01&lt;/STRONG&gt;&lt;BR /&gt;
             &lt;STRONG&gt;02&lt;/STRONG&gt; -- &lt;STRONG&gt;mailserver-02&lt;/STRONG&gt;&lt;BR /&gt;
              ...&lt;BR /&gt;
             &lt;STRONG&gt;10&lt;/STRONG&gt; -- &lt;STRONG&gt;mailserver-10&lt;/STRONG&gt;&lt;BR /&gt;
4) Scroll back to &lt;STRONG&gt;Default&lt;/STRONG&gt; field an choose &lt;STRONG&gt;01&lt;/STRONG&gt; as the default field value.&lt;/P&gt;

&lt;P&gt;PS: You can define lookup tables for more dynamic list and values and use Dynamic Options to populate Name/Value through Splunk Search String.&lt;/P&gt;

&lt;P&gt;Following is the Simple XML Source Code for the same (Notice root node changes from dashboard to form the moment we add any form inputs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fieldset&amp;gt;
  &amp;lt;input type="dropdown" token="selMailServer" searchWhenChanged="true"&amp;gt;
    &amp;lt;label&amp;gt;Select Mail Server&amp;lt;/label&amp;gt;
    &amp;lt;choice value="mailserver-01"&amp;gt;01&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-02"&amp;gt;02&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-03"&amp;gt;03&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-04"&amp;gt;04&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-05"&amp;gt;05&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-06"&amp;gt;06&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-07"&amp;gt;07&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-08"&amp;gt;08&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-09"&amp;gt;09&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="mailserver-10"&amp;gt;10&amp;lt;/choice&amp;gt;
    &amp;lt;default&amp;gt;mailserver-01&amp;lt;/default&amp;gt;
  &amp;lt;/input&amp;gt;
&amp;lt;/fieldset&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;5) Finally, in your search you can replace &lt;STRONG&gt;mailserver-01&lt;/STRONG&gt; with &lt;STRONG&gt;$selMailServer$&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 12:03:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215492#M43397</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-11-09T12:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a dropdown...</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215493#M43398</link>
      <description>&lt;P&gt;Thank you...I've done this...however, is there a better way to not have to statically do this for every mail server?  Say Splunk starts indexing logs for mailserver-11...is there a way to dynamically add it?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 19:02:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215493#M43398</guid>
      <dc:creator>balleste</dc:creator>
      <dc:date>2016-11-09T19:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a dropdown...</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215494#M43399</link>
      <description>&lt;P&gt;Yes there are two ways. If you have a Splunk Search which can pull Server Names you can populate through Dynamic Option within dropdown.&lt;/P&gt;

&lt;P&gt;Alternatively you can load a spreadsheet in Splunk as Lookup table with Mail Server names and then use inputlookup search to populate via Dynamic Options in Dropdown. Spreadsheet can be manually updated each time mail server is added and also vis Splunk search.&lt;/P&gt;

&lt;P&gt;One other way would be Key Value (KV) Store as well. I have not worked with that though.&lt;/P&gt;

&lt;P&gt;Let me know if it addresses your problem, or if you need more details.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 19:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215494#M43399</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-11-09T19:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a dropdown...</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215495#M43400</link>
      <description>&lt;P&gt;How frequently the data comes on Splunk for a mail server? Do all mail server logs comes all the times?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 20:03:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215495#M43400</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-09T20:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a dropdown...</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215496#M43401</link>
      <description>&lt;P&gt;Here is a dynamic way to do it.  This will count up mail servers and add them to the drop down box.  If you 2 server it will show those two, if you have 100, it shows 100 servers.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="time" token="global_time" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Time frame&amp;lt;/label&amp;gt;
  &amp;lt;default&amp;gt;Last 24 hours&amp;lt;/default&amp;gt;
&amp;lt;/input&amp;gt;
&amp;lt;input type="dropdown" token="Mailserver" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Mailserver&amp;lt;/label&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;sourcetype=api "analyzed email count" 
      | rex "xxx (?&amp;lt;server&amp;gt;\S+)"              # Here you need to make a rex to extract name of your mail server 
      | top limit=0 server
    &amp;lt;earliest&amp;gt;$global_time.earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$global_time.latest$&amp;lt;/latest&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;choice value="*"&amp;gt;Any&amp;lt;/choice&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;server&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;server&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then in you panel you add the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=api "analyzed email count" $Mailserver$ | stats sum(mail_value) AS "Total"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you post some lines that show how mail server looks like, I can make the regex to extract it for you.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 20:22:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-a-dropdown/m-p/215496#M43401</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2016-11-09T20:22:30Z</dc:date>
    </item>
  </channel>
</rss>

