Splunk Search

External search command 'dbquery' returned error code 1. Script output = 'There is no such database [stt-dw] available for this user!'

jackiewkc
Path Finder

I have a search which does a basic query to a database using dbquery. I have a user which has a role assigned to it and this role has been given read/write permission to DB Connect and the database. The role also has the capabilites "dbx_capable" and "schedule_rtsearch". However, when running the search, I got the external command error as stated in the title of this question.

The weird thing is that if I add the role "dbx_user" as an inherited role to the role assigned to this user, the search works. The dbx_user role has only the two capabilites "dbx_capable" and "schedule_rtsearch and read/write permission to DB Connect and the database.

I don't understand why the role I created doesn't work since it has the same permissions as the dbx_user role.

Can someone please advise? Thanks.

Regards,
Jackie

Tags (2)

tahakhan
Engager

I encountered a similar error while running the below query:

Select count(Field) from Table

The error was:

External search command 'dbxquery' returned error code 1. Script output = " ERROR "Exception at ""/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbxquery.py"", line 123 : com.microsoft.sqlserver.jdbc.SQLServerException: No column name was specified for column 1 of 't'.

I changed the query to:

Select count(Field) as count_Field from Table

This resolved the issue. Thought I'd share this.

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...