Splunk Search

How to convert time from an inputlookup

cip1
Engager

Hi,
I need help in converting the time provided by a lookup.

| inputlookup AD_User_LDAP_list
| search cn=jon1
| fields cn, pwdLastSet

I am getting the information like this:

cn pwdLastSet
jon1 06:25.09 AM, Mon 07/15/2019

I tried running:
| eval start=strftime(pwdLastSet, %Y/%m%d)
but nothing has changed, I was getting the same results.

Basically, I am trying to find out when a user password will expire, based on the time it was last set.

0 Karma
1 Solution

diogofgm
SplunkTrust
SplunkTrust

Instead of trying to convert dates to calculate the expiration date you can, since you're getting data from AD LDAP, get the info from AD (field: accountExpires) already converted for you.

Still if you want to procede like this use

| eval start=strftime(strptime(pwdLastSet,"%I:%M.%S %p, %a %m/%d/%Y"),"%Y/%m/%d %H:%M:%S")
------------
Hope I was able to help you. If so, some karma would be appreciated.

View solution in original post

diogofgm
SplunkTrust
SplunkTrust

Instead of trying to convert dates to calculate the expiration date you can, since you're getting data from AD LDAP, get the info from AD (field: accountExpires) already converted for you.

Still if you want to procede like this use

| eval start=strftime(strptime(pwdLastSet,"%I:%M.%S %p, %a %m/%d/%Y"),"%Y/%m/%d %H:%M:%S")
------------
Hope I was able to help you. If so, some karma would be appreciated.

cip1
Engager

for some reason, the eval does not do anything different than before.
anyway, can you point me to where to get the date when an account password will expire? sorry for the question...pretty new to all this 😞

0 Karma

diogofgm
SplunkTrust
SplunkTrust

try the eval again. it was missing the hours. just corrected it

the AD field is called accountExpires. check with who created the lookup you're using to see if they can include more fields.

------------
Hope I was able to help you. If so, some karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...