Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle IPv6 address String correctly on host and hosts parameters #876

Closed
1 task
qixie1 opened this issue Mar 19, 2021 · 10 comments
Closed
1 task

Handle IPv6 address String correctly on host and hosts parameters #876

qixie1 opened this issue Mar 19, 2021 · 10 comments
Assignees

Comments

@qixie1
Copy link

qixie1 commented Mar 19, 2021

(check apply)

Problem

I use fluentd 1.9.1 and fluent-plugin-elasticsearch version: 4.0.9 i want user hosts by ipv6,it's doesn't work, how can i do
my config like this.

<match docker.**>
    @type "elasticsearch"
    hosts 2001:da8:2:10d::36:9201
    logstash_format true
    logstash_prefix "onc_v1_logservice_systemlog"
    logstash_dateformat "%Y-%m-%d"
    type_name "log"
    <buffer>
        @type file
        path /fluentd/log/dlog/elastic-buffer
        flush_thread_count 8
        flush_interval 1s
        flush_mode interval
        retry_max_interval 30
        retry_forever true
     </buffer>
</match>

fluent-plugin-elasticsearch version: 4.0.9

@qixie1
Copy link
Author

qixie1 commented Mar 19, 2021

2021-03-19 17:19:25 +0800 [error]: #0 unexpected error error_class=URI::InvalidURIError error="bad URI(is not URI?): 2001:da8:2:10d::36:9201"
2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/2.5.0/uri/rfc3986_parser.rb:67:in split' 2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/2.5.0/uri/rfc3986_parser.rb:73:in parse'
2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/2.5.0/uri/common.rb:237:in parse' 2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/2.5.0/uri/common.rb:743:in URI'
2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluent-plugin-elasticsearch-4.0.9/lib/fluent/plugin/out_elasticsearch.rb:595:in block in get_connection_options' 2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluent-plugin-elasticsearch-4.0.9/lib/fluent/plugin/out_elasticsearch.rb:585:in map'
2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluent-plugin-elasticsearch-4.0.9/lib/fluent/plugin/out_elasticsearch.rb:585:in get_connection_options' 2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluent-plugin-elasticsearch-4.0.9/lib/fluent/plugin/out_elasticsearch.rb:524:in client'
2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluent-plugin-elasticsearch-4.0.9/lib/fluent/plugin/elasticsearch_index_template.rb:36:in rescue in retry_operate' 2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluent-plugin-elasticsearch-4.0.9/lib/fluent/plugin/elasticsearch_index_template.rb:34:in retry_operate'
2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluent-plugin-elasticsearch-4.0.9/lib/fluent/plugin/out_elasticsearch.rb:440:in handle_last_seen_es_major_version' 2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluent-plugin-elasticsearch-4.0.9/lib/fluent/plugin/out_elasticsearch.rb:302:in configure'
2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.1/lib/fluent/plugin.rb:173:in configure' 2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.1/lib/fluent/agent.rb:132:in add_match'
2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.1/lib/fluent/agent.rb:74:in block in configure' 2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.1/lib/fluent/agent.rb:64:in each'
2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.1/lib/fluent/agent.rb:64:in configure' 2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.1/lib/fluent/root_agent.rb:146:in configure'
2021-03-19 17:19:25 +0800 [error]: #0 /usr/lib/ruby/gems/2.5.0/gems/fluentd-1.9.1/lib/fluent/engine.rb:105:in `configure'

@cosmo0920
Copy link
Collaborator

cosmo0920 commented Mar 19, 2021

Fluentd 1.9.1 is old and you are not filing using ES plugin version in issue template.
I'm not psychic.
Thanks.

@qixie1
Copy link
Author

qixie1 commented Mar 19, 2021

Fluentd 1.9.1 is old and you are not filing using ES plugin version in issue template.
I'm not psychic.
Thanks.

thanks for your reply,fluent-plugin-elasticsearch version: 4.0.9 and fluentd version 1.9.1

@cosmo0920
Copy link
Collaborator

cosmo0920 commented Mar 19, 2021

Fluentd 1.9.1 is old and you are not filing using ES plugin version in issue template.
I'm not psychic.
Thanks.

thanks for your reply,fluent-plugin-elasticsearch version: 4.0.9 and fluentd version 1.9.1

How about using host and port instead of hosts to handle IPv6 address?

@qixie1
Copy link
Author

qixie1 commented Mar 19, 2021

Fluentd 1.9.1 is old and you are not filing using ES plugin version in issue template.
I'm not psychic.
Thanks.

thanks for your reply,fluent-plugin-elasticsearch version: 4.0.9 and fluentd version 1.9.1

How about using host and port instead of hosts to handle IPv6 address?

when I using host and port instead of hosts, i found it doesn't working too

@cosmo0920
Copy link
Collaborator

I'd send a PR to handle IPv6 address String correctly on dependent faraday gem:
lostisland/faraday#1252

And also we should do more additional work to handle IPv6 address string on host and hosts parameters.

@cosmo0920 cosmo0920 changed the title fluentd's plugin @elasticsearch how to set ipv6 address Handle IPv6 address String correctly on host and hosts parameters Mar 22, 2021
@cosmo0920 cosmo0920 self-assigned this Mar 22, 2021
@cosmo0920
Copy link
Collaborator

I'd confirmed that patched faraday and #877 can handle IPv6 address string on host and hosts parameters.

@cosmo0920
Copy link
Collaborator

Faraday patch for incorrect IPv6 host handling is merged into upstream. But patched version is not released yet. We'll release a new version after the new Faraday is released.

@qixie1
Copy link
Author

qixie1 commented Mar 26, 2021

ok, thanks

@cosmo0920
Copy link
Collaborator

This should be fixed in v5.0.3 and the latest Faraday stable versions. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants