Dashboards & Visualizations

How to display day , month and time in single value tile

jaibalaraman
Path Finder

Hi 

 

How to display the day / month / time / year like the below format using simple format 

 

Ex- | make result 

jaibalaraman_0-1730779659064.png

 

Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @jaibalaraman ,

you have to change the time format in strftime command applying the format you like following the formats at https://docs.splunk.com/Documentation/Splunk/9.3.1/SearchReference/Commontimeformatvariables :

| makeresults
| eval refresh_time=strftime(_time, "%A,%d/%m/%Y %Z %H:%M:%S") 
| table refresh_time

 Ciao.

Giuseppe

View solution in original post

0 Karma

PickleRick
SplunkTrust
SplunkTrust

OK. But what is your issue here?

You have a timestamp but don't know how to render it into text with a given format? For that you use either eval or fieldformat with a strftime function.

Or you already have a string value but have some problems with putting it on a dashboard? (what problems exactly?)

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jaibalaraman ,

you have to use the table command and the field containing the date to display:

<your_search>
| table timestamp

There's on ly one problem I can see: having a long string like the one you shared, chars in the Single Value will be very small.

Maybe you could use more than one Single Value displaying parts of the timestamp.

Ciao.

Giuseppe

0 Karma

jaibalaraman
Path Finder

Hi All 

I running the below command 

| makeresults
| eval refresh_time=strftime(_time, "%A,%Y-%m-%d %H:%M:%S") | table refresh_time



jaibalaraman_0-1730852167574.png

 

 

How to change the position like below 

Tuesday , 11/05/2024 NZST 22:12:39

 

Thanks

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jaibalaraman ,

you have to change the time format in strftime command applying the format you like following the formats at https://docs.splunk.com/Documentation/Splunk/9.3.1/SearchReference/Commontimeformatvariables :

| makeresults
| eval refresh_time=strftime(_time, "%A,%d/%m/%Y %Z %H:%M:%S") 
| table refresh_time

 Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jaibalaraman ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated by all the contributors 😉

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...