Hi
How to display the day / month / time / year like the below format using simple format
Ex- | make result
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
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?)
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
Hi All
I running the below command
| makeresults
| eval refresh_time=strftime(_time, "%A,%Y-%m-%d %H:%M:%S") | table refresh_time
How to change the position like below
Tuesday , 11/05/2024 NZST 22:12:39
Thanks
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
Hi @jaibalaraman ,
good for you, see next time!
Ciao and happy splunking
Giuseppe
P.S.: Karma Points are appreciated by all the contributors 😉