How to apply external plugin to telegraf configuration?

Hi, I’m a beginner with telegraf and have been using with elasticsearch for days which worked fine, but I’m attempting to put data into MariaDB for some reasons. I ran telegraf without applying any plugins and below error occured

2022-11-30T05:49:59Z I! Starting Telegraf 1.12.6
2022-11-30T05:49:59Z E! [telegraf] Error running agent: Error parsing /telegraf/tel-vs.conf, Undefined but requested output: sql

so I’ve been researching for a couple of days and found alot about internal plugins but not a chance with external plugins. Below configuration is what I’m trying to run with .

Is there any guides for applying external plugins to use [[outputs.sql]] ?

Thanks in advance!


  interval = "5s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "5s"
  flush_jitter = "0s"
  precision = ""
  debug = true
  quiet = false
  logfile = "/home/logs/telegraf/tel-vs.log"
  logfile_rotation_interval = "24h"
  logfile_rotation_max_archives = 7
  hostname = "localhost"
  omit_hostname = false

 agents = [""]
 version = 2
 community = "test"

name = "test"

 oid = "temp"
 name = "temp_name"

  ## Database driver
  ## Valid options: mssql (Microsoft SQL Server), mysql (MySQL), pgx (Postgres),
  ##  sqlite (SQLite3), snowflake ( clickhouse (ClickHouse)
  driver = "mysql"
  data_source_name = "xxxx:xxxx@tcp("
  table_template = 'CREATE TABLE "test_table"({COLUMNS})'
  init_sql = "SET sql_mode='ANSI_QUOTES';"

Hello @alvinpark0904,
By external plugins do you mean:
telegraf/ at master · influxdata/telegraf · GitHub?
I think if you’re using an external input plugin you might have to use an external output plugin to write the data to sql.

This is a very, very old version of Telegraf. So old in fact that I do not think it even has the sql output.

v1.12.x definitively does not have an SQL output plugin. This was released first in v1.19.0…