Splunk Search

Error in 'where' command - how to track down?

the_wolverine
Champion

I'm seeing the following error in splunkd.log:

ERROR SearchOperator:filter - Error in 'where' command: The operator at 't>0' is invalid.

It occurs regularly so my first guess is a scheduled search that uses the 'where' command. (Am I on track?) I'm only using 'where' in one place currently and its in a conditional search where the condition is " where count>2 "

Is there a bug related to using 'where' as a condition?

Tags (2)
0 Karma

woodcock
Esteemed Legend

This is a very common cut-and-paste problem and it can be very hard to find. What happens when you cut your search, it had wrapped around the screen to show on more than one line and when you pasted it, it went in like this:

blah blah blah | where coun
t>2

So Splunk is interpreting your search command as

blah blah blah | where coun t>2

Instead of this:

blah blah blah | where count>2

The kicker is that, because where you are viewing your saved search is sized such that the broken and unbroken versions look exactly the same, it is impossible to spot! Now that you know what the problem is, go in and remove the extra newline.

0 Karma

Mick
Splunk Employee
Splunk Employee

Does it produce an error when you run the search manually?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...