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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...