Archive
Highlighted

Using foreach and dbquery, why am I getting error "'foreach' command: Search pipeline may not contain non-streaming commands"?

Engager

Hi everybody

This error is causing me problems.
From a result set (a table with a "name" field) I want to run this type of request:

<query>foreach name [|dbquery "maBase" "SELECT summary,id FROM maBase.maTable"| search summary=*name*]</query>

This means that for each line, searching a database (dbquery) and I return results based on the presence of the name in the "summary" of my base.

however, I found an error:
'foreach' command: Search pipeline may not contain non-streaming commands

if someone has an idea
thank you all

Sébastien

0 Karma
Highlighted

Re: Using foreach and dbquery, why am I getting error "'foreach' command: Search pipeline may not contain non-streaming commands"?

Champion

dbquery has to be the first command in a search. You could do your filtering after that though, something like this: https://answers.splunk.com/answers/75999/splunk-db-connect-dbquery-inline-search-and-time-filtering-...

0 Karma
Speak Up for Splunk Careers!

We want to better understand the impact Splunk experience and expertise has has on individuals' careers, and help highlight the growing demand for Splunk skills.