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!

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...