<?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: Concatenate date in label in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172078#M186483</link>
    <description>&lt;P&gt;by using the simple xml code and combination of javascript and read only text box I achieved this...thanks everyone for your valuable inputs..&lt;/P&gt;</description>
    <pubDate>Tue, 04 Mar 2014 17:05:10 GMT</pubDate>
    <dc:creator>vikas_gopal</dc:creator>
    <dc:date>2014-03-04T17:05:10Z</dc:date>
    <item>
      <title>Concatenate date in label</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172070#M186475</link>
      <description>&lt;P&gt;Hi Everyone,&lt;BR /&gt;
Is it possible to concatenate current date and time with dashboard label e.g. my dashboard label is "Monthly status report" and I want to show it as "Monthly status report" + "Current date and time".Please suggest me how to do it and if it is not possible with concatenate then how I can achieve this ?&lt;/P&gt;

&lt;P&gt;Thanks in advance  &lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 17:12:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172070#M186475</guid>
      <dc:creator>vikas_gopal</dc:creator>
      <dc:date>2014-03-03T17:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate date in label</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172071#M186476</link>
      <description>&lt;P&gt;do you have javascript available to you?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 17:20:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172071#M186476</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2014-03-03T17:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate date in label</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172072#M186477</link>
      <description>&lt;P&gt;I have prepared a javascript which shows me a date in an alert now how I can link this to label ...&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 18:28:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172072#M186477</guid>
      <dc:creator>vikas_gopal</dc:creator>
      <dc:date>2014-03-03T18:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate date in label</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172073#M186478</link>
      <description>&lt;P&gt;You can concatenate fields values in an &lt;CODE&gt;eval&lt;/CODE&gt; command using the dot as separator.&lt;/P&gt;

&lt;P&gt;examples :&lt;BR /&gt;
&lt;CODE&gt;&amp;lt;mywonderfulsearch&amp;gt; | eval newfield=fieldA.fieldB | table newfield&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;mywonderfulsearch&amp;gt; | eval newfield=fieldA." and my other information is ".fieldB | table newfield&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If you have fields names already in a string with spaces, you will have to use double quotes, so it may mess up the eval.&lt;BR /&gt;
I recommend to use simple fields names, and rename then at the end at display time.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 00:06:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172073#M186478</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2014-03-04T00:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate date in label</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172074#M186479</link>
      <description>&lt;P&gt;Assuming you are using advanced XML for your dashboard and you're willing to use SideView Utils' HTML module, the following will work;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="HiddenSearch" autoRun="True"&amp;gt;
    &amp;lt;param name="search"&amp;gt;index=_internal | stats count | eval ReportLabel = "Monthly status report ".strftime( time(), "%B %e, %Y %k:%M:%S %p") | table ReportLabel&amp;lt;/param&amp;gt;
    &amp;lt;module name="HTML"&amp;gt;
        &amp;lt;param name="html"&amp;gt;
            &amp;lt;![CDATA[
            &amp;lt;p&amp;gt;$results[0].ReportLabel$&amp;lt;/p&amp;gt;
            ]]&amp;gt;
        &amp;lt;/param&amp;gt;
    &amp;lt;/module&amp;gt;  
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You don't necessarily need to concatenate with an eval either. You could change the code above as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval = strftime( time(), "%B %e, %Y %k:%M:%S %p")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;![CDATA[
&amp;lt;p&amp;gt;Monthly status report $results[0].ReportLabel$&amp;lt;/p&amp;gt;
]]&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: index=_internal can be swapped for whatever index you feel comfortable using&lt;/P&gt;

&lt;P&gt;You can format the date/time using Splunk's date and time format variables: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Commontimeformatvariables"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Commontimeformatvariables&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 00:46:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172074#M186479</guid>
      <dc:creator>jhowkins</dc:creator>
      <dc:date>2014-03-04T00:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate date in label</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172075#M186480</link>
      <description>&lt;P&gt;If you want implement the date as a text label in your dashboard using Javascript, you can also do the following (again, I'm assuming you're using advanced XML and SideView Utils' HTML module);&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="HTML"&amp;gt;
    &amp;lt;param name="html"&amp;gt;
    &amp;lt;![CDATA[

    &amp;lt;script&amp;gt;
        var theDate = new Date();
        $$(function() {
        $$( "#ReportTitle" ).text(theDate);
        });
    &amp;lt;/script&amp;gt;

    &amp;lt;h3&amp;gt;Monthly status report &amp;lt;Label id="ReportTitle" &amp;gt;&amp;lt;/h3&amp;gt;

    ]]&amp;gt;
    &amp;lt;/param&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 02:22:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172075#M186480</guid>
      <dc:creator>jhowkins</dc:creator>
      <dc:date>2014-03-04T02:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate date in label</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172076#M186481</link>
      <description>&lt;P&gt;@yannK Thanks for the reply but how I can use eval command with label .I can use it in search bar only....&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 09:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172076#M186481</guid>
      <dc:creator>vikas_gopal</dc:creator>
      <dc:date>2014-03-04T09:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate date in label</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172077#M186482</link>
      <description>&lt;P&gt;@jhowkins thanks for quick response..I am not using SideView Utils, I am working on simple XML .Is it possible with simple XML..?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 10:00:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172077#M186482</guid>
      <dc:creator>vikas_gopal</dc:creator>
      <dc:date>2014-03-04T10:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate date in label</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172078#M186483</link>
      <description>&lt;P&gt;by using the simple xml code and combination of javascript and read only text box I achieved this...thanks everyone for your valuable inputs..&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 17:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172078#M186483</guid>
      <dc:creator>vikas_gopal</dc:creator>
      <dc:date>2014-03-04T17:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate date in label</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172079#M186484</link>
      <description>&lt;P&gt;understood, the eval works for the results, not the panels names.&lt;BR /&gt;
the javascript is the way to go.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 17:32:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-date-in-label/m-p/172079#M186484</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2014-03-04T17:32:00Z</dc:date>
    </item>
  </channel>
</rss>

