Splunk Search

Need last logon for a user

chrodriguez
Engager

Need to know what was the last time a domain AD account “username” was logged into and from what server/machine please?

Labels (1)
Tags (1)
0 Karma
1 Solution

nwuest
Path Finder

Hi @chrodriguez,

So you are specifically looking for the account "wmsadmin", which is disabled to see the last time that it was used to log in?

Have you been collecting logs in your environment with splunk forwarders since "9/20/2011" the date of the lastLogonTimestamp?

  • If you have had splunk forwarders collecting events for that long, what is your retention policy with frozen buckets?
  • If not, you can try to kickoff an event with 'enabling that account, logging in-and-out with it then disabling the account'.
    Then you should see some activity in your searchhead so that search will return some results.

Let us know what happens!

V/R,
nwuest

 

View solution in original post

0 Karma

nwuest
Path Finder

Hi @chrodriguez,

So you are specifically looking for the account "wmsadmin", which is disabled to see the last time that it was used to log in?

Have you been collecting logs in your environment with splunk forwarders since "9/20/2011" the date of the lastLogonTimestamp?

  • If you have had splunk forwarders collecting events for that long, what is your retention policy with frozen buckets?
  • If not, you can try to kickoff an event with 'enabling that account, logging in-and-out with it then disabling the account'.
    Then you should see some activity in your searchhead so that search will return some results.

Let us know what happens!

V/R,
nwuest

 

0 Karma

chrodriguez
Engager

thanks for the insight, I completely forgot that we have only had splunk introduced since 2016. So thats why its not populating data from 2011.

 

 

0 Karma

chrodriguez
Engager

That doesn't return anything, I really need to focus on "A User" not just everything. I ran this, and it returned nothing for the account but then when I try against my user account it does return data. The account wmsadmin is indeed an actual user account that is disabled and the "lastLogonTimestamp" has a value or date of 9/20/2011.

index=wineventlog sourcetype=WinEventLog:Security (EventCode=4624 OR EventCode=4634 "wmsadmin")
| eval day=strftime(_time,"%d/%m/%Y")
| stats earliest(_time) AS earliest latest(_time) AS latest by user host day
| eval earliest=strftime(earliest,"%d/%m/%Y %H.%M.%S"), latest=strftime(latest,"%d/%m/%Y %H.%M.%S")

0 Karma

nwuest
Path Finder

Hi @chrodriguez 

Try this:

EventCode=4624 | dedup ComputerName | table ComputerName _time

View solution in original post 

Let us know if this works for you

V/R,
nwuest

0 Karma

chrodriguez
Engager

That doesn't return anything, I really need to focus on "A User" not just everything. I ran this, and it returned nothing for the account but then when I try against my user account it does return data. The account wmsadmin is indeed an actual user account that is disabled and the "lastLogonTimestamp" has a value or date of 9/20/2011. index=wineventlog sourcetype=WinEventLog:Security (EventCode=4624 OR EventCode=4634 "wmsadmin") | eval day=strftime(_time,"%d/%m/%Y") | stats earliest(_time) AS earliest latest(_time) AS latest by user host day | eval earliest=strftime(earliest,"%d/%m/%Y %H.%M.%S"), latest=strftime(latest,"%d/%m/%Y %H.%M.%S")

0 Karma
Get Updates on the Splunk Community!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...