Dashboards & Visualizations

Date formatting in dashboard studio?

wkrupinsky
Explorer

I am using a single value in a dashboard, it is only showing a date, but I cannot get the date to format the way want it on the dashboard. My search string is: index=conmon earliest=11/23/2022:00:00:00 dedup LASTMODIFIED eval tst = strftime(strptime(LASTMODIFIED, %Y-%m-%d), %Y-%m-%d) fields tst

want 11-23-2022 , but continue to get 2022-11-23T13:35:53-05:00

The search on its own brings back the value correctly, but not on the dashboard. Any help would b greatly appreciated.

Bill K

Labels (1)
0 Karma

wkrupinsky
Explorer

richgalloway, maybe this makes more sense, here is my search string: index=conmon earliest>="12/05/2022:00:00:00" | dedup _time | eval mytime=strftime(_time, "%F") | table mytime

as a search I get back the value correctly, when I use this search in a dashboard singlevalue panel, i get utc with time as the value showing

0 Karma

richgalloway
SplunkTrust
SplunkTrust

I can't reproduce this problem.  The query displays times in my selected time zone in both the search window and in a dashboard.

---
If this reply helps you, Karma would be appreciated.
0 Karma

wkrupinsky
Explorer

richgalloway, changing the format did not help. LASTMODIFIED doe snot come up as a choice, just _time or tst(null) as the selected data field. it is date time. but a string in the data itself

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What do you mean by "LASTMODIFIED does not come up as a choice"? Is LASTMODIFIED a field? If not then why is it in the query?

Please share sanitized sample events if you need help extracting LASTMODIFIED.

---
If this reply helps you, Karma would be appreciated.

richgalloway
SplunkTrust
SplunkTrust

The format string in strftime is incorrect. Try "%m-%d-%Y".

index=conmon earliest=11/23/2022:00:00:00 
| dedup LASTMODIFIED 
| eval tst = strftime(strptime(LASTMODIFIED, "%Y-%m-%d"), "%m-%d-%Y") 
| fields tst
---
If this reply helps you, Karma would be appreciated.

richgalloway
SplunkTrust
SplunkTrust

That depends, however, on the format of the LASTMODIFIED field. Would you please share that?

---
If this reply helps you, Karma would be appreciated.
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...