<?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: In a dashboard's HTML code, how do I dynamically append a date to an image filename? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-s-HTML-code-how-do-I-dynamically-append-a-date-to/m-p/275660#M17455</link>
    <description>&lt;P&gt;Add this to the top of your dashboard. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;search&amp;gt;&amp;lt;query&amp;gt;| makeresults | eval dt=strftime(_time, "%d%m%Y")&amp;lt;/query&amp;gt;
      &amp;lt;done&amp;gt;
        &amp;lt;set token="filename"&amp;gt;image_.$result.dt$.jpg&amp;lt;/set&amp;gt;
      &amp;lt;/done&amp;gt;    
    &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And change your &lt;CODE&gt;IMG&lt;/CODE&gt; tag to this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;img src="/static/app/search/$filename$" /&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 28 Oct 2016 11:46:00 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-10-28T11:46:00Z</dc:date>
    <item>
      <title>In a dashboard's HTML code, how do I dynamically append a date to an image filename?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-s-HTML-code-how-do-I-dynamically-append-a-date-to/m-p/275659#M17454</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;img src="/static/app/search/image.PNG"/&amp;gt; 
   &amp;lt;/html&amp;gt;
   &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Currently am using above patch of code in my Splunk dashboard to show the picture which is working fine. &lt;BR /&gt;
But, as per the requirement, the file will change everyday and the filename will change to image_28102016 which includes today's date. So how to add this date field parameter to the filename so that it will pick up the latest file always? &lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 10:31:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-s-HTML-code-how-do-I-dynamically-append-a-date-to/m-p/275659#M17454</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2016-10-28T10:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard's HTML code, how do I dynamically append a date to an image filename?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-s-HTML-code-how-do-I-dynamically-append-a-date-to/m-p/275660#M17455</link>
      <description>&lt;P&gt;Add this to the top of your dashboard. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;search&amp;gt;&amp;lt;query&amp;gt;| makeresults | eval dt=strftime(_time, "%d%m%Y")&amp;lt;/query&amp;gt;
      &amp;lt;done&amp;gt;
        &amp;lt;set token="filename"&amp;gt;image_.$result.dt$.jpg&amp;lt;/set&amp;gt;
      &amp;lt;/done&amp;gt;    
    &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And change your &lt;CODE&gt;IMG&lt;/CODE&gt; tag to this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;img src="/static/app/search/$filename$" /&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Oct 2016 11:46:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-s-HTML-code-how-do-I-dynamically-append-a-date-to/m-p/275660#M17455</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-28T11:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard's HTML code, how do I dynamically append a date to an image filename?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-s-HTML-code-how-do-I-dynamically-append-a-date-to/m-p/275661#M17456</link>
      <description>&lt;P&gt;Hi Sundareshr,&lt;/P&gt;

&lt;P&gt;I used this patch of code but still the image is not coming up. Is there any other way to troubleshoot it through any log file where I can see what exact file name its taking. &lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 07:16:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-s-HTML-code-how-do-I-dynamically-append-a-date-to/m-p/275661#M17456</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2016-10-31T07:16:25Z</dc:date>
    </item>
  </channel>
</rss>

