<?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: Drop Down Menu with Time in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107627#M6091</link>
    <description>&lt;P&gt;When you say "use a different saved search that is configured with is_visible=False." what do you mean?  Can you explain?&lt;/P&gt;</description>
    <pubDate>Thu, 23 Dec 2010 05:17:51 GMT</pubDate>
    <dc:creator>gnovak</dc:creator>
    <dc:date>2010-12-23T05:17:51Z</dc:date>
    <item>
      <title>Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107622#M6086</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to add a drop down menu to a chart I have created on my dashboard but I can't seem to get it to work.  The code for the chart on my dashboard is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;label&amp;gt;Balance Email Summary - Last 24 Hours&amp;lt;/label&amp;gt;
&amp;lt;row&amp;gt;    
&amp;lt;chart&amp;gt;
  &amp;lt;title&amp;gt;Total Emails For All Registries&amp;lt;/title&amp;gt;
  &amp;lt;searchName&amp;gt;balance_email_sent_and_tosend&amp;lt;/searchName&amp;gt;
 &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
&amp;lt;option name="charting.primaryAxisTitle.text"&amp;gt;Date&amp;lt;/option&amp;gt;
&amp;lt;option name="charting.secondaryAxisTitle.text"&amp;gt;Number of Emails&amp;lt;/option&amp;gt;
 &amp;lt;option name="charting.chart.useAbsoluteSpacing"&amp;gt;true&amp;lt;/option&amp;gt;
 &amp;lt;option name="charting.chart.columnSpacing"&amp;gt;5&amp;lt;/option&amp;gt;
 &amp;lt;option name="charting.legend.placement"&amp;gt;top&amp;lt;/option&amp;gt;
&amp;lt;/chart&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I'd like to add a drop down menu to this so that users can select the time span they would like for the search.&lt;/P&gt;

&lt;P&gt;The code I have for the drop down menu is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="time"/&amp;gt;    
&amp;lt;input type="dropdown" token="timeSpan"&amp;gt;
&amp;lt;label&amp;gt;Time span for charts&amp;lt;/label&amp;gt;
&amp;lt;default&amp;gt;span=4h&amp;lt;/default&amp;gt;
&amp;lt;choice value="span=5m"&amp;gt;5 Minute&amp;lt;/choice&amp;gt;
&amp;lt;choice value="span=10m"&amp;gt;10 Minutes&amp;lt;/choice&amp;gt;
&amp;lt;choice value="span=1h"&amp;gt;1 hour&amp;lt;/choice&amp;gt;
&amp;lt;choice value="span=4h"&amp;gt;4 hours&amp;lt;/choice&amp;gt;
&amp;lt;choice value="span=24h"&amp;gt;24 hours&amp;lt;/choice&amp;gt;
&amp;lt;choice value="span=7d"&amp;gt;7 days&amp;lt;/choice&amp;gt;
&amp;lt;choice value="rt"&amp;gt;Real-time&amp;lt;/choice&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've tried inserting this before row and after row but I still can't seem to get it to show up or work.  Is there something anyone notices out of the ordinary that I could be missing?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2010 04:31:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107622#M6086</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2010-12-22T04:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107623#M6087</link>
      <description>&lt;P&gt;Also here is the search as well:  sourcetype="cron_BalanceEmail" (source="&lt;EM&gt;asia&lt;/EM&gt;" OR source="&lt;EM&gt;info&lt;/EM&gt;" OR source="&lt;EM&gt;org&lt;/EM&gt;") starthoursago="120" BalanceEmail sent | rex field=_raw "[BalanceEmail] ?(?&lt;TOTALEMAILSSENT&gt;[\d]+) of (?&lt;TOTALEMAILSTOSEND&gt;[\d]+) of email notification sent." | search TotalEmailsToSend="&lt;EM&gt;" OR TotalEmailsSent="&lt;/EM&gt;"&lt;BR /&gt;
| timechart sum(TotalEmailsToSend) as TotalEmailsToSend sum(TotalEmailsSent) as TotalEmailsSent&lt;/TOTALEMAILSTOSEND&gt;&lt;/TOTALEMAILSSENT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:22:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107623#M6087</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T09:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107624#M6088</link>
      <description>&lt;P&gt;The simplified XML uses the &lt;CODE&gt;stringreplace&lt;/CODE&gt; intention, and the stringreplace intention is unique in that you have to specify in the search string where exactly the $timeSpan$ token should be inserted. &lt;/P&gt;

&lt;P&gt;So in light of that, one thing to try is changing your search to &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype="cron_BalanceEmail" (source="*asia*" OR source="*info*" OR source="*org*") starthoursago="120" BalanceEmail sent | rex field=_raw "\[BalanceEmail\] ?(?&amp;lt;TotalEmailsSent&amp;gt;[\d]+) of (?&amp;lt;TotalEmailsToSend&amp;gt;[\d]+) of email notification sent\." | search TotalEmailsToSend="*" OR TotalEmailsSent="*" | timechart $timeSpan$ sum(TotalEmailsToSend) as TotalEmailsToSend sum(TotalEmailsSent) as TotalEmailsSent&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;(Note the $timeSpan$ token now living in the timechart clause)&lt;/P&gt;

&lt;P&gt;An obvious problem with the stringreplace intention here is of course that the saved search will not function correctly outside of this one custom view. The $timeSpan$ argument will not get replaced when the search is run straight from the menu so it'll throw a search language syntax error.   What you have to do then if you want that saved search to be both visible and functional, is to specify the search inline with &lt;CODE&gt;&amp;lt;search&amp;gt;&lt;/CODE&gt; instead of &lt;CODE&gt;&amp;lt;searchName&amp;gt;&lt;/CODE&gt; or use a different saved search that is configured with is_visible=False.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2010 04:50:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107624#M6088</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-12-22T04:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107625#M6089</link>
      <description>&lt;P&gt;I will try using the inline search and see if this works.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2010 05:22:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107625#M6089</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2010-12-22T05:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107626#M6090</link>
      <description>&lt;P&gt;I tried putting this search directly in the dashboard xml but it threw an error. I had &lt;SEARCHSTRING&gt;sourcetype="cron_BalanceEmail" (source="&lt;EM&gt;asia&lt;/EM&gt;" OR source="&lt;EM&gt;info&lt;/EM&gt;" OR source="&lt;EM&gt;org&lt;/EM&gt;") starthoursago="120" BalanceEmail sent | rex field=_raw "[BalanceEmail] ?(?&lt;TOTALEMAILSSENT&gt;[\d]+) of (?&lt;TOTALEMAILSTOSEND&gt;[\d]+) of email notification sent." | search TotalEmailsToSend="&lt;EM&gt;" OR TotalEmailsSent="&lt;/EM&gt;" | timechart $timeSpan$ sum(TotalEmailsToSend) as TotalEmailsToSend sum(TotalEmailsSent) as TotalEmailsSent&lt;/TOTALEMAILSTOSEND&gt; and it did not work.  Also where do I put the code for the drop down?&lt;/TOTALEMAILSSENT&gt;&lt;/SEARCHSTRING&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:22:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107626#M6090</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T09:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107627#M6091</link>
      <description>&lt;P&gt;When you say "use a different saved search that is configured with is_visible=False." what do you mean?  Can you explain?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2010 05:17:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107627#M6091</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2010-12-23T05:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107628#M6092</link>
      <description>&lt;P&gt;Also keep in mind that code for the drop down I "borrowed" from another example so the $timespan$ token i am not sure is relevant to the search or not.  I was trying to find more data on what exactly to specify for a token but that info is sometimes hard to find.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2010 05:20:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107628#M6092</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2010-12-23T05:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107629#M6093</link>
      <description>&lt;P&gt;I'm starting to wonder:  do i have to make this entire dashboard advanced XML now to be able to add a drop down menu where the user can select the timerange for the search results?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2010 05:40:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107629#M6093</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2010-12-23T05:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107630#M6094</link>
      <description>&lt;P&gt;You dont need a $foo$ token for the timeRange - it is handled in parallel with the search and as such does not appear in the search string.  And it &lt;EM&gt;should&lt;/EM&gt; work fine in the simplified XML to have both pulldowns but it's a pita to debug the simplified XML so I do recommend switching to the advanced XML. In the long run people find it easier to understand and deal with.&lt;/P&gt;

&lt;P&gt;And the token names themselves like '$timeSpan$' are meaningless - you can call it $monkey$ if you like.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2010 06:24:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107630#M6094</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-12-28T06:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107631#M6095</link>
      <description>&lt;P&gt;And by 'use a different saved search that is configured with is_visible=False',   Im just pointing out that if you need it to be a saved search for some reason,  it'll have the $foo$ tokens in it. This means when people go and run the search from the saved search menu it wont work cause those $foo$ tokens will be searched on as literals.  So you can have two copies of the saved search, and have the $foo$ one marked with is_visible=false such that it doesnt appear in the menu.  hth&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:22:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107631#M6095</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2020-09-28T09:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107632#M6096</link>
      <description>&lt;P&gt;This is the xml that adds the time drop down menu and execute the new search when changed:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
&amp;lt;label&amp;gt;FOO&amp;lt;/label&amp;gt;
&amp;lt;title&amp;gt;Total Emails For All Registries&amp;lt;/title&amp;gt;
&amp;lt;fieldset autoRun="true" submitButton="false"&amp;gt;
    &amp;lt;input type="time" searchWhenChanged="true" /&amp;gt;
    &amp;lt;default&amp;gt;Last 24 hours&amp;lt;/default&amp;gt;
&amp;lt;/fieldset&amp;gt;
&amp;lt;row&amp;gt;
    &amp;lt;chart&amp;gt;
        &amp;lt;title&amp;gt;Matching events&amp;lt;/title&amp;gt;
        &amp;lt;searchTemplate&amp;gt;&amp;lt;![CDATA[ sourcetype="cron_BalanceEmail" (source="*asia*" OR source="*info*" OR source="*org*") BalanceEmail sent | rex field=_raw "\[BalanceEmail\] ?(?&amp;lt;TotalEmailsSent&amp;gt;[\d]+) of (?&amp;lt;TotalEmailsToSend&amp;gt;[\d]+) of email notification sent\." | search TotalEmailsToSend="*" OR TotalEmailsSent="*" | timechart sum(TotalEmailsToSend) as TotalEmailsToSend sum(TotalEmailsSent) as TotalEmailsSent ]]&amp;gt;&amp;lt;/searchTemplate&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.primaryAxisTitle.text"&amp;gt;Date&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.secondaryAxisTitle.text"&amp;gt;Number of Emails&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.useAbsoluteSpacing"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.columnSpacing"&amp;gt;5&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;top&amp;lt;/option&amp;gt;
  &amp;lt;module name="TimeRangePicker"&amp;gt;
  &amp;lt;param name="selected"&amp;gt;All time&amp;lt;/param&amp;gt;
  &amp;lt;param name="searchWhenChanged"&amp;gt;True&amp;lt;/param&amp;gt;
   &amp;lt;/module&amp;gt;
&amp;lt;/chart&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;
&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2010 07:31:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107632#M6096</guid>
      <dc:creator>mzax</dc:creator>
      <dc:date>2010-12-29T07:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107633#M6097</link>
      <description>&lt;P&gt;This actually works if I make a new "view" or dashboard and put this code in it.  However I am having issues trying to incorporate this code with my current dashboard.  At some point the view shows up as "None" in the views menu and when I click it I get an error.&lt;/P&gt;

&lt;P&gt;I'm still looking into this but not sure why it's doing this.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2010 23:59:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107633#M6097</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2010-12-29T23:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Drop Down Menu with Time</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107634#M6098</link>
      <description>&lt;P&gt;I had to take out &lt;DASHBOARD&gt; from the top of the code and &lt;/DASHBOARD&gt; from the bottom of the code.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2010 00:32:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drop-Down-Menu-with-Time/m-p/107634#M6098</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2010-12-30T00:32:08Z</dc:date>
    </item>
  </channel>
</rss>

