- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Everyone,
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 ?
Thanks in advance
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
by using the simple xml code and combination of javascript and read only text box I achieved this...thanks everyone for your valuable inputs..
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
by using the simple xml code and combination of javascript and read only text box I achieved this...thanks everyone for your valuable inputs..
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
<module name="HTML">
<param name="html">
<![CDATA[
<script>
var theDate = new Date();
$$(function() {
$$( "#ReportTitle" ).text(theDate);
});
</script>
<h3>Monthly status report <Label id="ReportTitle" ></h3>
]]>
</param>
</module>
I hope this helps!
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jhowkins thanks for quick response..I am not using SideView Utils, I am working on simple XML .Is it possible with simple XML..?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assuming you are using advanced XML for your dashboard and you're willing to use SideView Utils' HTML module, the following will work;
<module name="HiddenSearch" autoRun="True">
<param name="search">index=_internal | stats count | eval ReportLabel = "Monthly status report ".strftime( time(), "%B %e, %Y %k:%M:%S %p") | table ReportLabel</param>
<module name="HTML">
<param name="html">
<![CDATA[
<p>$results[0].ReportLabel$</p>
]]>
</param>
</module>
</module>
You don't necessarily need to concatenate with an eval either. You could change the code above as follows:
eval = strftime( time(), "%B %e, %Y %k:%M:%S %p")
and
<![CDATA[
<p>Monthly status report $results[0].ReportLabel$</p>
]]>
Note: index=_internal can be swapped for whatever index you feel comfortable using
You can format the date/time using Splunk's date and time format variables: http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Commontimeformatvariables
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

You can concatenate fields values in an eval
command using the dot as separator.
examples :
<mywonderfulsearch> | eval newfield=fieldA.fieldB | table newfield
<mywonderfulsearch> | eval newfield=fieldA." and my other information is ".fieldB | table newfield
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.
I recommend to use simple fields names, and rename then at the end at display time.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

understood, the eval works for the results, not the panels names.
the javascript is the way to go.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@yannK Thanks for the reply but how I can use eval command with label .I can use it in search bar only....
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have prepared a javascript which shows me a date in an alert now how I can link this to label ...
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
do you have javascript available to you?
