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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...