config - Fluentd Configuration File, get filename in <source> and pass it to <match> as a tag -
i trying write clean configuration file fluentd + fluentd-s3-plugin , use many files.
i want avoid copy , pasting every <source>
, every <match>
every file, make kinda dynamic. have until now:
<source> @type tail path /var/www/blabla/blabla/log/production.log pos_file /var/www/blabla/blabla/log/production.log.pos tag production-log format /(?<time>.*)/ </source> <match production-log> @type s3 s3_bucket xxxx s3_region xxxx path "staging/%y/%m/%d/#{socket.gethostname}/" s3_object_key_format "%{path}productionlog-%{time_slice}-#{socket.gethostname}-%{index}.%{file_extension}" # if want use ${tag} or %y/%m/%d/ syntax in path / s3_object_key_format, # need specify tag ${tag} , time %y/%m/%d in <buffer> argument. <buffer tag,time> @type file tag ${tag} path /var/www/blabla/blabla/log/buffer/ timekey 3600 # (default 3600) 1 hour partition timekey_wait 1m timekey_use_utc true # use utc </buffer> <format> @type json </format> </match>
as can see, use production-log many times, questions 2:
how use filename in tag
?
how use passed tag in s3_object_key_format
? (i know there instructions commented don't it)
Comments
Post a Comment