Splunk Search

How to edit my eval syntax to convert a date from Active Directory to epoch time?

kiran331
Builder

Hi

How to convert the date format from the active directory to epoch time?

date format:

2016-10-23T05:00:00Z

I tried:

....|eval endDate= strptime(accountExpires,"%Y-%m-%dT%H:%M:%SZ")

but it's not showing anything.

0 Karma
1 Solution

sundareshr
Legend

Try this

| makeresults | eval accountExpires="2016-10-23T05:00:00Z"|eval endDate= strptime(accountExpires,"%Y-%m-%dT%H:%M:%S")  | eval x=strftime(endDate, "%Y-%m-%dT%H:%M:%S") | table accountExpires endDate x

View solution in original post

0 Karma

sundareshr
Legend

Try this

| makeresults | eval accountExpires="2016-10-23T05:00:00Z"|eval endDate= strptime(accountExpires,"%Y-%m-%dT%H:%M:%S")  | eval x=strftime(endDate, "%Y-%m-%dT%H:%M:%S") | table accountExpires endDate x
0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...