<?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 control earliest and latest in the search string using forms in XML? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155964#M9557</link>
    <description>&lt;P&gt;I speciffically want to be able to control this in the search &lt;CODE&gt;earliest=-20d@d&lt;/CODE&gt;changing it to this &lt;CODE&gt;earliest=-30d@d&lt;/CODE&gt; or this &lt;CODE&gt;earliest=-40d@d&lt;/CODE&gt; for example. Maybe i am taking the wrong approach.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Apr 2015 21:47:06 GMT</pubDate>
    <dc:creator>HattrickNZ</dc:creator>
    <dc:date>2015-04-23T21:47:06Z</dc:date>
    <item>
      <title>How to control earliest and latest in the search string using forms in XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155962#M9555</link>
      <description>&lt;P&gt;i have the following search in my xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= ... earliest=-20d@d latest=+d@d | timechart ...  | timewrap ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I control the search using a form? I basically want to be able to control this &lt;CODE&gt;earliest=-20d@d latest=+d@d&lt;/CODE&gt; and I only want to increase the value &lt;CODE&gt;20&lt;/CODE&gt; up or down. Maybe I should use some other type of form control? &lt;/P&gt;

&lt;P&gt;This is my 1st attempt:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;label&amp;gt;Timeframe&amp;lt;/label&amp;gt;
&amp;lt;default&amp;gt;
  &amp;lt;earliestTime&amp;gt;-20d&amp;lt;/earliestTime&amp;gt;
  &amp;lt;latestTime&amp;gt;now&amp;lt;/latestTime&amp;gt;
&amp;lt;/default&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Apr 2015 20:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155962#M9555</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-04-23T20:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to control earliest and latest in the search string using forms in XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155963#M9556</link>
      <description>&lt;P&gt;Here is an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form &amp;gt;
  &amp;lt;label&amp;gt;Single Value Customization: Panel Color&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false" autoRun="true"&amp;gt;
    &amp;lt;input type="time" token="time" searchWhenChanged="true"&amp;gt;
      &amp;lt;label/&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliestTime&amp;gt;0&amp;lt;/earliestTime&amp;gt;
        &amp;lt;latestTime&amp;gt;now&amp;lt;/latestTime&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="index" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Choose one index&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;populatingSearch fieldForLabel="index" fieldForValue="index"&amp;gt;| eventcount summarize=false index=* OR index=_*&amp;lt;/populatingSearch&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;single id="id1"&amp;gt;
      &amp;lt;title&amp;gt;Count of all events in index=$index$&amp;lt;/title&amp;gt;
      &amp;lt;searchString&amp;gt;index=$index$ OR index=_$index$|stats count&amp;lt;/searchString&amp;gt;
      &amp;lt;earliestTime&amp;gt;$time.earliest$&amp;lt;/earliestTime&amp;gt;
      &amp;lt;latestTime&amp;gt;$time.latest$&amp;lt;/latestTime&amp;gt;
      &amp;lt;option name="field"&amp;gt;count&amp;lt;/option&amp;gt;
      &amp;lt;option name="beforeLabel"&amp;gt;There is&amp;lt;/option&amp;gt;
      &amp;lt;option name="afterLabel"&amp;gt;Total Events&amp;lt;/option&amp;gt;
      &amp;lt;option name="underLabel"&amp;gt;All events&amp;lt;/option&amp;gt;
    &amp;lt;/single&amp;gt;

  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Apr 2015 21:36:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155963#M9556</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-04-23T21:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to control earliest and latest in the search string using forms in XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155964#M9557</link>
      <description>&lt;P&gt;I speciffically want to be able to control this in the search &lt;CODE&gt;earliest=-20d@d&lt;/CODE&gt;changing it to this &lt;CODE&gt;earliest=-30d@d&lt;/CODE&gt; or this &lt;CODE&gt;earliest=-40d@d&lt;/CODE&gt; for example. Maybe i am taking the wrong approach.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2015 21:47:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155964#M9557</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-04-23T21:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to control earliest and latest in the search string using forms in XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155965#M9558</link>
      <description>&lt;P&gt;Hi HatNZ,&lt;/P&gt;

&lt;P&gt;If i undertanded well your task, try with xml code that follow: with this, you can specify either -20d ,-30d or more in the input text. It work fine! &lt;BR /&gt;
Try to run it!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
      &amp;lt;label&amp;gt;time&amp;lt;/label&amp;gt;
      &amp;lt;fieldset submitButton="true"&amp;gt;

        &amp;lt;input type="text" token="time_tok"&amp;gt;
          &amp;lt;label&amp;gt;Specify a time&amp;lt;/label&amp;gt;
          &amp;lt;default&amp;gt;-20d&amp;lt;/default&amp;gt;
        &amp;lt;/input&amp;gt;
      &amp;lt;/fieldset&amp;gt;
      &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;
          &amp;lt;table&amp;gt;
            &amp;lt;search&amp;gt;
              &amp;lt;query&amp;gt;index=_internal | stats count by sourcetype |head 10&amp;lt;/query&amp;gt;
              &amp;lt;earliest&amp;gt;$time_tok$&amp;lt;/earliest&amp;gt;
              &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
            &amp;lt;/search&amp;gt;
          &amp;lt;/table&amp;gt;
        &amp;lt;/panel&amp;gt;
      &amp;lt;/row&amp;gt;
    &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Apr 2015 21:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155965#M9558</guid>
      <dc:creator>ngatchasandra</dc:creator>
      <dc:date>2015-04-23T21:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to control earliest and latest in the search string using forms in XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155966#M9559</link>
      <description>&lt;P&gt;tks, I adapted that to do something like this. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
     &amp;lt;input type="text" token="time_tok"&amp;gt;&lt;BR /&gt;
       &amp;lt;label&amp;gt;Specify a time&amp;lt;/label&amp;gt;&lt;BR /&gt;
       &amp;lt;default&amp;gt;-20d@d&amp;lt;/default&amp;gt;&lt;BR /&gt;
     &amp;lt;/input&amp;gt;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index= ... earliest=$time_tok$ latest=+d@d | timechart ...  | timewrap ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;this way i am controlling from &lt;CODE&gt;earliest=$time_tok$&lt;/CODE&gt; part using the &lt;CODE&gt;input&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2015 22:22:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155966#M9559</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-04-23T22:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to control earliest and latest in the search string using forms in XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155967#M9560</link>
      <description>&lt;P&gt;what do you want now? Are you satisfy?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2015 22:27:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155967#M9560</guid>
      <dc:creator>ngatchasandra</dc:creator>
      <dc:date>2015-04-23T22:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to control earliest and latest in the search string using forms in XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155968#M9561</link>
      <description>&lt;P&gt;Hi ,&lt;BR /&gt;
As you have adapted your code,if it produce no error it is ok. now try this:&lt;BR /&gt;
1- create an input for integer .&lt;BR /&gt;
2-use the input token like this:&lt;/P&gt;

&lt;P&gt;index= ... earliest=-$time_tok$d@d&lt;BR /&gt;
latest=+d@d | timechart ... |&lt;BR /&gt;
timewrap ...&lt;/P&gt;

&lt;P&gt;3- you can even remove "earliest=-"   and "d@d" and put them in fieldset as token prefix and token suffix.&lt;BR /&gt;
the query will now be:&lt;/P&gt;

&lt;P&gt;index= ...  $time_tok$&lt;BR /&gt;
latest=+d@d | timechart ... |&lt;BR /&gt;
timewrap ...&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2015 22:48:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-control-earliest-and-latest-in-the-search-string-using/m-p/155968#M9561</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2015-04-23T22:48:09Z</dc:date>
    </item>
  </channel>
</rss>

