<?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: How to create 2 tokens from 1 drop-down selection? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-2-tokens-from-1-drop-down-selection/m-p/145783#M8846</link>
    <description>&lt;P&gt;Can you add two more fields in the source? &lt;BR /&gt;
eval etime = _time | eval ltime = _time+86400&lt;/P&gt;

&lt;P&gt;And call form.target.earliest=$row.etime$&amp;amp;form.target.latest=$row.ltime$&lt;/P&gt;

&lt;P&gt;I had similar requirement &lt;BR /&gt;
Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
    <pubDate>Tue, 17 Feb 2015 18:36:02 GMT</pubDate>
    <dc:creator>Raghav2384</dc:creator>
    <dc:date>2015-02-17T18:36:02Z</dc:date>
    <item>
      <title>How to create 2 tokens from 1 drop-down selection?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-2-tokens-from-1-drop-down-selection/m-p/145782#M8845</link>
      <description>&lt;P&gt;Hi All;&lt;/P&gt;

&lt;P&gt;I'm trying to create a custom time picker which will allow users to select a &lt;STRONG&gt;specific&lt;/STRONG&gt; day (not every day is here, which is why this has to be custom) from a drop down and then from that selected  value produce 2 tokens: one to represent the earliest time and one for the latest time. Problem is that the drop down will only let me choose 1 field to populate the value. Splunk does give the option to do "change" in the source code to set another token but from there you are only able to set the token to the &lt;STRONG&gt;value&lt;/STRONG&gt; or the &lt;STRONG&gt;label&lt;/STRONG&gt; of the drop down. &lt;/P&gt;

&lt;P&gt;In my situation the label represents a specific date and the value represents the epoch &lt;EM&gt;earliest/beginning&lt;/EM&gt; timestamp for the date. what I want to do is something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;       &amp;lt;set token="latest_test"&amp;gt;$value$+86400&amp;lt;/set&amp;gt;
       &amp;lt;set token="earliest_test"&amp;gt;$value$&amp;lt;/set&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The only problem is that the latest_value just takes the "+86400" as a character and does not form any mathematical addition. &lt;/P&gt;

&lt;P&gt;Any suggestions on how to get over this problem would be extremely appreciated. If they involve using some kind of JS file, that's great but could you provide an example of one as I'm not too experienced with JS. &lt;/P&gt;

&lt;P&gt;Also,This input is a dynamic input which comes from a table that has the fields &lt;STRONG&gt;title&lt;/STRONG&gt; (used as the label in the drop down), &lt;STRONG&gt;earliest&lt;/STRONG&gt; (used as the value in the drop down), and latest (NOT used anywhere). If there was a way to assign this latest value to a token, that would also be extremely helpful as well.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Tyler&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 17:23:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-2-tokens-from-1-drop-down-selection/m-p/145782#M8845</guid>
      <dc:creator>tdiestel</dc:creator>
      <dc:date>2015-02-17T17:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create 2 tokens from 1 drop-down selection?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-2-tokens-from-1-drop-down-selection/m-p/145783#M8846</link>
      <description>&lt;P&gt;Can you add two more fields in the source? &lt;BR /&gt;
eval etime = _time | eval ltime = _time+86400&lt;/P&gt;

&lt;P&gt;And call form.target.earliest=$row.etime$&amp;amp;form.target.latest=$row.ltime$&lt;/P&gt;

&lt;P&gt;I had similar requirement &lt;BR /&gt;
Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 18:36:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-2-tokens-from-1-drop-down-selection/m-p/145783#M8846</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-02-17T18:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to create 2 tokens from 1 drop-down selection?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-2-tokens-from-1-drop-down-selection/m-p/145784#M8847</link>
      <description>&lt;P&gt;Works great! thank you for helping me out with this. &lt;/P&gt;

&lt;P&gt;here's my code for a reference:&lt;/P&gt;

&lt;P&gt;App Usage&lt;BR /&gt;
  This Dashboard gives a full overview of many different App components.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="date" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Select a Date&amp;lt;/label&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;index=index_1 source="dbmon-tail://db_1/new_timepicker"| dedup id| fields id title earliest latest|sort - id&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;title&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;earliest&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;default&amp;gt;@d&amp;lt;/default&amp;gt;
  &amp;lt;change&amp;gt;
    &amp;lt;set token="latest_test"&amp;gt;$row.latest$&amp;lt;/set&amp;gt;
    &amp;lt;set token="earliest_test"&amp;gt;$row.earliest$&amp;lt;/set&amp;gt;
  &amp;lt;/change&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;.....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;panel&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;title&amp;gt;Overall App Usage Trend Chart&amp;lt;/title&amp;gt;
        &amp;lt;searchString&amp;gt;index=index_2|stats count
        &amp;lt;earliestTime&amp;gt;$earliest_test$&amp;lt;/earliestTime&amp;gt;
        &amp;lt;latestTime&amp;gt;$latest_test$&amp;lt;/latestTime&amp;gt;
 ellipsisNone
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.rotation"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;collapsed&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY2.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.enabled"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;zero&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0.01&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;default&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.style"&amp;gt;shiny&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.labelStyle.overflowMode"&amp;gt;ellipsisMiddle&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;bottom&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY2.text"&amp;gt;Actions per User&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.overlayFields"&amp;gt;"Actions per User"&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Feb 2015 19:01:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-2-tokens-from-1-drop-down-selection/m-p/145784#M8847</guid>
      <dc:creator>tdiestel</dc:creator>
      <dc:date>2015-02-17T19:01:02Z</dc:date>
    </item>
  </channel>
</rss>

