Splunk Dev

Changing time format

zacksoft
Contributor

Currently I'm using a stats command to populate a few fields along with time.
The command is as follows,
stats values(session_id) as Session values(_time) as Time values(action) as Action_Performed values(success) as Rate by usage

Here I get Time in a strange format , like 1515424081.
Is there any way to change the format to something readable ?

Tags (1)
0 Karma
1 Solution

mayurr98
Super Champion

hey @zacksoft

try this

<your_base_query> |stats values(session_id) as Session values(_time) as Time values(action) as Action_Performed values(success) as Rate by usage | eval c_time=strftime(Time,"%m/%d/%y %H:%M:%S")

Let me know if it works!

View solution in original post

mayurr98
Super Champion

hey @zacksoft

try this

<your_base_query> |stats values(session_id) as Session values(_time) as Time values(action) as Action_Performed values(success) as Rate by usage | eval c_time=strftime(Time,"%m/%d/%y %H:%M:%S")

Let me know if it works!

zacksoft
Contributor

@mayurr98 Perfecto !!

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...