Skip to content

Commit 834ffe3

Browse files
committed
Fix: Leading slash in fluentd graylog exporte logs 2
1 parent 7de90da commit 834ffe3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/logging/fluentd/fluent.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
# Add additional metadata
3636
<filter docker.**>
3737
@type record_transformer
38+
enable_ruby true
3839
<record>
3940
hostname "#{Socket.gethostname}"
4041
fluentd_hostname "#{ENV['FLUENTD_HOSTNAME']}"
4142
tag ${tag}
42-
container_name ${record["container_name"] && record["container_name"].start_with?("/") ? record["container_name"][1..-1] : record["container_name"]}
43-
log_service ${record["log_service"] && record["log_service"].start_with?("/") ? record["log_service"][1..-1] : record["log_service"]}
43+
container_name ${record["container_name"].gsub(/^\/+/, "")}
44+
log_service ${record["log_service"].gsub(/^\/+/, "")}
4445
</record>
4546
</filter>
4647

0 commit comments

Comments
 (0)