<?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: Displaying Dynamic date in Simple XML dashboard in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Displaying-Dynamic-date-in-Simple-XML-dashboard/m-p/171054#M10517</link>
    <description>&lt;P&gt;You won't be able to change the &lt;CODE&gt;&amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;&lt;/CODE&gt; value that populates the form/dashboard title using Simple XML.  However, you can change the value that populates the title of a panel if you convert to using a form search.  Here's a working example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Splunk Answers (125114) Example&amp;lt;/label&amp;gt;
  &amp;lt;fieldset autoRun="false" submitButton="false"&amp;gt;
    &amp;lt;input type="text" token="name"&amp;gt;
      &amp;lt;label&amp;gt;Command:&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;suffix&amp;gt;*&amp;lt;/suffix&amp;gt;
    &amp;lt;/input&amp;gt;

    &amp;lt;input type="dropdown" token="begin" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Choose Start Date:&amp;lt;/label&amp;gt;
      &amp;lt;populatingSearch fieldForLabel="day" fieldForValue="day"&amp;gt;
        sourcetype="syslog" | bucket span=1d _time AS day | dedup day | sort -day | convert timeformat="%B %d %Y" ctime(day)
      &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;table&amp;gt;
      &amp;lt;title&amp;gt;syslog "COMMANDS" since $begin$&amp;lt;/title&amp;gt;
      &amp;lt;searchString&amp;gt;sourcetype="syslog" [|gentimes start=-1 | eval earliest=strptime("$begin$","%B %d %Y") | fields earliest] | search COMMAND="$name$"&amp;lt;/searchString&amp;gt;
      &amp;lt;option name="count"&amp;gt;5&amp;lt;/option&amp;gt;
      &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;option name="drilldown"&amp;gt;row&amp;lt;/option&amp;gt;
    &amp;lt;/table&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically, I created a dropdown that replaces the time picker and allows you to choose the start date for your form.  You can use the time picker and it's &lt;CODE&gt;$earliest$&lt;/CODE&gt; token instead but the value placed into &lt;CODE&gt;$earliest$&lt;/CODE&gt; will be something like &lt;CODE&gt;-30d@d&lt;/CODE&gt; which isn't helpful as the date to be displayed in the panel title.&lt;/P&gt;

&lt;P&gt;If you need to specify a start time different from some day at midnight, you'll just have to be sure you also modify the &lt;CODE&gt;strptime()&lt;/CODE&gt; parameters.  Also, it would be simple to add a second dropdown to specify the ending date/time.  Alertantively, you could add a time picker and use the &lt;CODE&gt;$earliest$&lt;/CODE&gt; and &lt;CODE&gt;$latest$&lt;/CODE&gt; tokens created by the time picker to set bounds on the date dropdown.&lt;/P&gt;

&lt;P&gt;But the bottom line is that you can't change the title of the form/dashboard using Simple XML.&lt;/P&gt;</description>
    <pubDate>Sun, 16 Mar 2014 16:41:02 GMT</pubDate>
    <dc:creator>gauldridge</dc:creator>
    <dc:date>2014-03-16T16:41:02Z</dc:date>
    <item>
      <title>Displaying Dynamic date in Simple XML dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Displaying-Dynamic-date-in-Simple-XML-dashboard/m-p/171053#M10516</link>
      <description>&lt;P&gt;I created a dashboard using Simple XML under Splunk 6. I created a search "* | stats count | addinfo | eval date=strftime(info_min_time,"%B %d %Y") | fields date" and currently use a single value box. I would prefer to put that date at the top of the dashboard in the label. I need to use Simple XML so I can email the report daily to the end user.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:01:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Displaying-Dynamic-date-in-Simple-XML-dashboard/m-p/171053#M10516</guid>
      <dc:creator>coleman07</dc:creator>
      <dc:date>2020-09-28T16:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Dynamic date in Simple XML dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Displaying-Dynamic-date-in-Simple-XML-dashboard/m-p/171054#M10517</link>
      <description>&lt;P&gt;You won't be able to change the &lt;CODE&gt;&amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;&lt;/CODE&gt; value that populates the form/dashboard title using Simple XML.  However, you can change the value that populates the title of a panel if you convert to using a form search.  Here's a working example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Splunk Answers (125114) Example&amp;lt;/label&amp;gt;
  &amp;lt;fieldset autoRun="false" submitButton="false"&amp;gt;
    &amp;lt;input type="text" token="name"&amp;gt;
      &amp;lt;label&amp;gt;Command:&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;suffix&amp;gt;*&amp;lt;/suffix&amp;gt;
    &amp;lt;/input&amp;gt;

    &amp;lt;input type="dropdown" token="begin" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Choose Start Date:&amp;lt;/label&amp;gt;
      &amp;lt;populatingSearch fieldForLabel="day" fieldForValue="day"&amp;gt;
        sourcetype="syslog" | bucket span=1d _time AS day | dedup day | sort -day | convert timeformat="%B %d %Y" ctime(day)
      &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;table&amp;gt;
      &amp;lt;title&amp;gt;syslog "COMMANDS" since $begin$&amp;lt;/title&amp;gt;
      &amp;lt;searchString&amp;gt;sourcetype="syslog" [|gentimes start=-1 | eval earliest=strptime("$begin$","%B %d %Y") | fields earliest] | search COMMAND="$name$"&amp;lt;/searchString&amp;gt;
      &amp;lt;option name="count"&amp;gt;5&amp;lt;/option&amp;gt;
      &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;option name="drilldown"&amp;gt;row&amp;lt;/option&amp;gt;
    &amp;lt;/table&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically, I created a dropdown that replaces the time picker and allows you to choose the start date for your form.  You can use the time picker and it's &lt;CODE&gt;$earliest$&lt;/CODE&gt; token instead but the value placed into &lt;CODE&gt;$earliest$&lt;/CODE&gt; will be something like &lt;CODE&gt;-30d@d&lt;/CODE&gt; which isn't helpful as the date to be displayed in the panel title.&lt;/P&gt;

&lt;P&gt;If you need to specify a start time different from some day at midnight, you'll just have to be sure you also modify the &lt;CODE&gt;strptime()&lt;/CODE&gt; parameters.  Also, it would be simple to add a second dropdown to specify the ending date/time.  Alertantively, you could add a time picker and use the &lt;CODE&gt;$earliest$&lt;/CODE&gt; and &lt;CODE&gt;$latest$&lt;/CODE&gt; tokens created by the time picker to set bounds on the date dropdown.&lt;/P&gt;

&lt;P&gt;But the bottom line is that you can't change the title of the form/dashboard using Simple XML.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Mar 2014 16:41:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Displaying-Dynamic-date-in-Simple-XML-dashboard/m-p/171054#M10517</guid>
      <dc:creator>gauldridge</dc:creator>
      <dc:date>2014-03-16T16:41:02Z</dc:date>
    </item>
  </channel>
</rss>

