I cannot use tag_parts or tag_prefix in the output [Q&A] #4541
Unanswered
jtamayo-appgate
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is a problem?
The tag_parts or tag prefix in the output does not work.
I have the output configuration to send it to opensearch and an S3 bucket and I am setting the path with tag_parts but it does not print the value but the string.
The output for example for the index is:
{"index":{"_index":"dtp-${tag_parts[1]}-2024.06.25"}}
Describe the configuration of Fluentd
01_sources.conf: |-
02_filters.conf: |-
<label @kubernetes>
<match kubernetes.var.log.containers.fluentd**>
@type relabel
@Label @FLUENT_LOG
03_dispatch.conf: |-
<label @dispatch>
<filter **>
@type prometheus
@log_level debug
name fluentd_input_status_num_records_total
type counter
desc The total number of incoming records
tag ${tag}
hostname ${hostname}
04_outputs.conf: |-
<label @output>
<match **>
@type copy
@type opensearch
@log_level debug
host "#{ENV['FLUENT_ELASTICSEARCH_HOST'] || 'elasticsearch.elastic-kibana'}"
port "#{ENV['FLUENT_ELASTICSEARCH_PORT'] || '9200'}"
scheme "#{ENV['FLUENT_ELASTICSEARCH_SCHEME'] || 'http'}"
ssl_verify "#{ENV['FLUENT_ELASTICSEARCH_SSL_VERIFY']}"
ssl_version "#{ENV['FLUENT_ELASTICSEARCH_SSL_VERSION']}"
logstash_prefix "#{ENV['KUBERNETES_CLUSTER']}-${tag_parts[1]}"
include_tag_key false
logstash_format true
request_timeout 60s
with_transporter_log true
time_key_exclude_timestamp true
verify_es_version_at_startup false
<buffer tag,time>
@type file
path /var/log/fluentd-buffers/opensearch
timekey 10m
timekey_wait 2m
timekey_use_utc true
flush_interval 10s
chunk_limit_size 1g
total_limit_size 5g
@type s3
s3_bucket my_bucket
s3_region us-east-1
path ${tag_parts[1]}/${tag_parts[2]}/${tag_parts[3]}/
time_slice_format %Y/%m/%d/%H/%Hh-%Mm-${tag_parts[4]}
buffer_chunk_limit 50m
buffer_queue_limit 2048
timekey 10m
flush_interval 10m
Describe the logs of Fluentd
No response
Environment
Beta Was this translation helpful? Give feedback.
All reactions