Closed applike-ss closed 2 years ago
Hi @applike-ss, you are correct! You can go ahead and remove "_policy" from this occurrence: https://github.com/uken/fluent-plugin-elasticsearch/blob/master/lib/fluent/plugin/out_elasticsearch_data_stream.rb#L82
Thank you for pointing it out! :)
@fiscafusca thank you, i will prepare a PR. Currently checking and fixing tests.
Problem
I am using the elasticsearch_data_stream output with dynamic data_stream_name based on the tag. It seems that the policy generated has "_policy" twice in the name.
So while i would assume this:
i do get this:
I did have a quick look into the code and assume that it relates to
data_stream_ilm_name
being appended with _policy in multiple occurences: https://github.com/uken/fluent-plugin-elasticsearch/blob/master/lib/fluent/plugin/out_elasticsearch_data_stream.rb#L30 and https://github.com/uken/fluent-plugin-elasticsearch/blob/master/lib/fluent/plugin/out_elasticsearch_data_stream.rb#L82While my finding could be true and a solution could be as simple as removing the appending of
_policy
in thecreate_ilm_policy
function, i am not enough into ruby (first day today) that i feel confident of not breaking something.Steps to replicate
config:
...
Using Fluentd and ES plugin versions
Fluentd boot logs:
fluent-gem list
,td-agent-gem list
or your Gemfile.lock