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!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...