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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...