Splunk Search

How to leave date (in a field) is before today?

KH
Engager

I'm extremely new to Splunk and finding learning SPL very frustrating.

I'm trying to look for windows log on events/ attempted log ons by leavers accounts after their last working day. How do i say where a specific field (the last working day) is before todays date. 

The last working day field which I'm pulling from a separate index is in the following format "2020-02-28 00:00:00.0"

 

 

Labels (2)
0 Karma

KH
Engager

thank you! 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You need to parse the last working day into an epoch time, then compare it to the epoch time for the start of the current day.

| where strptime(last_working_day_field,"%Y-%m-%d %H:%M:%S") < relative_time(now(),"@d")
Get Updates on the Splunk Community!

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

SignalFlow: What? Why? How?

What is SignalFlow? Splunk Observability Cloud’s analytics engine, SignalFlow, opens up a world of in-depth ...

Federated Search for Amazon S3 | Key Use Cases to Streamline Compliance Workflows

Modern business operations are supported by data compliance. As regulations evolve, organizations must ...