Deployment Architecture

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

sebdemarss
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

jcoates_splunk
Splunk Employee
Splunk Employee

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
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 ...