influxdata/telegraf

Variable schema for postgressql output plugin

Open

#16747 opened on Apr 9, 2025

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Go (9,892 stars) (4,161 forks)batch import
feature requesthelp wantedsize/s

Description

Use Case

I have a PostgresSQL DB with several schemas. schemaA, schemaB, etc., in which I feed data from sensors through the mqtt_consumer plugin.

After a bit of processing, the measurement names look like "correspondingSchema_sensorName"

Expected behavior

I would like to be able to set the schema-name from a tag, which I would drop afterwards.

Actual behavior

Right now I have to define several outputs, one for each schema:

[[outputs.postgresql]]
namepass = ["schemaA_*"]
schema = "schemaA"

[[outputs.postgresql]]
namepass = ["schemaB_*"]
schema = "schemaB"

Additional info

No response

Contributor guide