Splunk Search

How to find events between date ranges

riveraj1
Observer

I am trying to find the events that are taking place between March 1 2021 and September 1 2021. I was hoping someone could tell me where I am going wrong in my search.

| eval timestampDate=strptime(ScheduledStartDate, "%m/%d/%Y")
| eval project_start=strptime("03/01/2021", "%m/%d/%Y")
| eval project_end=strptime("09/01/2021", "%m/%d/%Y")
| eval formattedTimestamp = strftime(timestamp, "%Y-%m-%d")
| where timestampDate >= project_start AND timestampDate <= project_end
| table Country timestampDate

Labels (1)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @riveraj1,

Assuming the time range covers the required events, everything seems fine, maybe there is a simple typo. Can you please share a few sample events?

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...