All Apps and Add-ons

Is there a way to loop connections in DBConnect? Trying to perform a statement across several connections.

paimonsoror
Builder

Hi all;

We are trying to do some database monitoring which requires us to perform a few select statements across multiple different connections. Instead of creating about 100 saved searches that run periodically, I was hoping that I could simply leverage a for-loop that would use an inputlookup to loop a list of connection names.

Unfortunately I run into the streaming-vs-nonstreaming issue which puts me at a roadblock. Any chance that someone can assist with a possible workaround / alternative to what I am trying to accomplish?

| inputlookup dbconnection.csv
| foreach connection_name [ | dbxquery connection=<<FIELD>> query="select INSTANCE_NAME,STATUS,DATABASE_STATUS from v$instance" ]
0 Karma
1 Solution

tiagofbmm
Influencer

Hey

I believe what you are looking for is the map function.

With that you can use the exact same dbxquery to differebt connections easily.

Check the map command here https://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Map

View solution in original post

tiagofbmm
Influencer

Hey

I believe what you are looking for is the map function.

With that you can use the exact same dbxquery to differebt connections easily.

Check the map command here https://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Map

paimonsoror
Builder

Thanks so much for this, sent you the reward points 🙂

... oops ... i think i actually sent you double the points lol .... oh well.

0 Karma

paimonsoror
Builder

omg, so simple. I'm testing this now and will report back / reward!

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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