This is a list of available drivers for the SQL input plugin. The data-source-name (DSN) is driver specific and might change between versions. Please check the driver documentation for available options and the format.
database | driver | aliases | example DSN | comment |
---|---|---|---|---|
ClickHouse | clickhouse | tcp://host:port[?param1=value&...¶mN=value]" |
see clickhouse-go docs for more information | |
CockroachDB | cockroach | postgres or pgx | see postgres driver | uses PostgresQL driver |
FlightSQL | flightsql | flightsql://[username[:password]@]host:port?timeout=10s[&token=TOKEN][¶m1=value1&...¶mN=valueN] |
see driver docs for more information | |
IBM Netezza | nzgo | host=your_nz_host port=5480 user=your_nz_user password=your_nz_password dbname=your_nz_db_name sslmode=disable |
see driver docs for more | |
MariaDB | maria | mysql | see mysql driver | uses MySQL driver |
Microsoft SQL Server | sqlserver | mssql | sqlserver://username:password@host/instance?param1=value¶m2=value |
uses newer sqlserver driver |
MySQL | mysql | [username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN] |
see driver docs for more information | |
Oracle | oracle | oracle | oracle://username:password@host:port/service?param1=value¶m2=value |
see driver docs for more information |
PostgreSQL | postgres | pgx | postgresql://[user[:password]@][netloc][:port][,...][/dbname][?param1=value1&...] |
see postgres docs for more information |
SAP HANA | go-hdb | hana | hdb://user:password@host:port |
see driver docs for more information |
SQLite | sqlite | filename |
see driver docs for more information | |
TiDB | tidb | mysql | see mysql driver | uses MySQL driver |
Some database drivers are supported though another driver (e.g. CockroachDB). For other databases we provide a more obvious name (e.g. postgres) compared to the driver name. For all of those drivers you might use an alias name during configuration.
The given examples are just that, so please check the driver documentation for the exact format and available options and parameters. Please note that the format of a DSN might also change between driver version.
Telegraf relies on type conversion of the database driver and/or the golang sql framework. In case you find any problem, please open an issue!
If nothing seems to work, you might find help in the telegraf forum or in the chat.
Please open an issue or even better send a pull-request!
Please open an issue or even better send a pull-request!
We currently cannot support CGO drivers in telegraf! Please check if a pure Go driver for the golang sql framework exists. If you found such a driver, please let us know by opening an issue or even better by sending a pull-request!