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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...