Splunk Search

How do I create a search for Event id 4742 (-30 Days)?

Freeza
Explorer

hi team,
I'm creating a query that I need to look for if a machine changed the password (Password_last_set) more than once for a period of 30 days. I'm not getting it, can you help me? example: if I put the code below with earliest=-90d it brings me the 3 changes. more if I put | search count > 1 it doesn't gather the information and doesn't bring me the statistics.

some help me?

 

Query: (Dont Work)

index="main" source="wineventlog:security" EventCode=4742 user="TRBK8SPRD06$"
| stats count earliest(_time) as firstTime latest(_time) as lastTime values(user) by Password_Last_Set, user, signature

| convert timeformat="%d/%m/%Y %H:%M:%S" ctime(firstTime) | convert timeformat="%d/%m/%Y %H:%M:%S" ctime(lastTime) |  search count > 1

WORK:

index="main" source="wineventlog:security" EventCode=4742 user="TRBK8SPRD06$"
| stats count earliest(_time) as firstTime latest(_time) as lastTime values(user) by Password_Last_Set, user, signature

| convert timeformat="%d/%m/%Y %H:%M:%S" ctime(firstTime) | convert timeformat="%d/%m/%Y %H:%M:%S" ctime(lastTime) 

thanks in advanced

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try where instead of count

| where count > 1

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Try where instead of count

| where count > 1

Freeza
Explorer

hi bro, 

it worked, for those who want to use or improve.

index="main" source="wineventlog:security" EventCode=4742 user="hostname$"
| stats count earliest(_time) as firstTime latest(_time) as lastTime values(user) as machines by user, signature
| convert timeformat="%d/%m/%Y %H:%M:%S" ctime(firstTime) | convert timeformat="%d/%m/%Y %H:%M:%S" ctime(lastTime) | where count > 1

 

thanks in advanced

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...