Splunk Search

subsearch error

myli12
Path Finder

I tried to use subsearch to find the 2nd last synchronization event by using the following:

synchronization [search synchronization | head 1 | eval earliest=relative_time(_time,"-1H") | eval latest=_time | fields earliest, latest]

but I received the error message

Error in 'search' command: Unable to parse the search: 'AND' operator is missing a clause on the left hand side.

What is wrong here and what is the fix? Thanks.

Tags (1)

gkanapathy
Splunk Employee
Splunk Employee

It would be a lot easier and fast to get the second last one with:

synchronization | head 2 | tail 1

But the explanation for your error is http://splunk-base.splunk.com/answers/8271/error-in-unifiedsearch-unable-to-parse-the-missing-lhs-fo...

so:

synchronization [search synchronization | head 1 | eval earliest=relative_time(_time,"-1H") | eval latest=_time | fields earliest, latest | format "(" "(" " " ")" "OR" ")" ]
0 Karma
Get Updates on the Splunk Community!

Bridging the Gap: Splunk Helps Students Move from Classroom to Career

The Splunk Community is a powerful network of users, educators, and organizations working together to tackle ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureThursday, March 27, 2025  |  11AM PST / 2PM EST | Register NowStep boldly ...