Splunk Search

Where condition based on date / time for imported data

ozirus
Path Finder

Hi,

I've a CSV imported data (hostname = AVGMAILCOUNT) and want to use its data based on present time values.

What I'm trying to do is searching that data according to current time parameters but i get error; (Error in 'search' command: Unable to parse the search: Comparator '=' is missing a term on the right hand side.)

I want search all data historially but for only same days (mondays for example)

Query gives above error;

host="AVGMAILCOUNT" date_wday = [ search eval A=strftime(now(),"%A") | return A]

Regards,

0 Karma
1 Solution

gfuente
Motivator

Hello

Use this subsearch instead:

host="AVGMAILCOUNT" date_wday = [|stats count | eval A=strftime(now(),"%A") | return $A]

regards

View solution in original post

0 Karma

gfuente
Motivator

Hello

Use this subsearch instead:

host="AVGMAILCOUNT" date_wday = [|stats count | eval A=strftime(now(),"%A") | return $A]

regards

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...