SQL Query
Description
Write an SQL query to execute on a compatible database server and generate logs from the result.
Supported Platforms
Bindplane Collector: v1.40.0
+
Linux
✓
Windows
✓
macOS
✓
Configuration
Driver
Which database driver should be used. Typically indicates which kind of database is being queried. Options include "postgres", "mysql", "snowflake", "sqlserver", and "oracle".
Hostname
The hostname or IP address of the database server.
Port
The port number on which the database server is listening.
Database
The name of the database to connect to.
Username
The username to use for authentication with the database.
Password
The password to use for authentication with the database.
Database Connection Options
A driver specific string specifying how to connect to the database. Usually contains information like host, port, authorization credentials, TLS configuration, and other connection options.
Query
The SQL query to run. The results of the query are used to generate the telemetry specified below.
Log Body Column
Defines the name of the column whose value will become the body for the generated log.
Attribute Columns
Defines columns whose values will become the attributes for the generated log.
Tacking Column
Used for parameterized queries. Defines the name of the column to retrieve for the parameter value on subsequent query runs. See this OTel Documentation for more information.
Tracking Start Value
Used for parameterized queries. Defines the initial value of the tracking column to compare against on subsequent query runs. See this OTel Documentation for more information.
Collection Interval
How frequently to execute queries to retrieve log data. Default is '10s'.
Enable Tracking Storage
If using tracking values, enable this to persist those values when the collector is restarted. Directory will be "$OIQ_OTEL_COLLECTOR_HOME/storage". See this OTel Documentation for more information.
Enable Query Logging
Whether or not the collector should log the SQL query with associated parameters when the query is ran.
Example Configuration
In this example, we are connecting to a postgres database using a postgres driver specific connection string. We are using a simple query which is retrieving rows of logs from a table. We are tracking the id
column to avoid creating duplicate logs.

Last updated
Was this helpful?