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 Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...