Dashboards & Visualizations

How do I display the current date and time on my dashboard?

vatsal1511
Explorer

I want to display current date and time on my dashboard. I'm currently using:

index=main | head 1 | eval month_year=strftime(now(),"%B %Y") | table month_year

to get month and year.
I want date, month, year and time.
Thanks

Tags (3)
0 Karma
1 Solution

sundareshr
Legend

Try this

index=main | head 1 | eval month_year=strftime(now(),"%c") | table month_year

http://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Commontimeformatvariables

View solution in original post

somesoni2
Revered Legend

Use following

| gentimes start=-1 | eval current_time=strftime(now(),"%B %d, %Y %H:%M") | table current_time

OR

| gentimes start=-1 | eval current_time=strftime(now(),"%+") | table current_time

vatsal1511
Explorer

Thanks @ somesoni2

0 Karma

sundareshr
Legend

Try this

index=main | head 1 | eval month_year=strftime(now(),"%c") | table month_year

http://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Commontimeformatvariables

vatsal1511
Explorer

Thanks @sundareshr

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...