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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...