Skip to content

Commit 8bd2f26

Browse files
committed
added telegraf processor that reduces the container_name
1 parent 40ea174 commit 8bd2f26

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

telegraf/telegraf.conf

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,21 @@
130130
# PROCESSOR PLUGINS #
131131
###############################################################################
132132

133-
# # Print all metrics that pass through this filter.
134-
# [[processors.printer]]
133+
[[processors.regex]]
134+
# This is a solution for the issue : https://github.com/janvda/balena-node-red-mqtt-nginx-TIG-stack/issues/10
135+
# So this processor will replace all container_name like "influxdb_643150_676670" into "influxdb"
136+
137+
# namepass lists all docker container measurements having tag container_name (see https://github.com/influxdata/telegraf/tree/master/plugins/inputs/docker)
138+
namepass = ["docker_container_mem","docker_container_cpu", "docker_container_net","docker_container_blkio","docker_container_health","docker_container_status" ]
139+
140+
# Tag and field conversions defined in a separate sub-tables
141+
# below processor will change a container name like "influxdb_643150_676670" into "influxdb"
142+
[[processors.regex.tags]]
143+
## Tag to change
144+
key = "container_name"
145+
## Regular expression to match on a tag value
146+
pattern = "^(.*)_[0-9]{6}_[0-9]{6}$"
147+
replacement = "${1}"
135148

136149

137150
###############################################################################

0 commit comments

Comments
 (0)