juju-solutions / layer-logstash

Other
2 stars 5 forks source link

hosts entries configured incorrectly in conf files #17

Closed kwmonroe closed 6 years ago

kwmonroe commented 8 years ago

I deployed 2 elasticsearch units and cs:~containers/trusty/logstash-4. I related them and got this in my conf:

ubuntu@machine-12:~$ grep hosts /etc/logstash/conf.d/*
/etc/logstash/conf.d/beats.conf:    hosts => ["10.1.0.11:9200, 10.1.0.10:9200"]
/etc/logstash/conf.d/legacy.conf:       hosts => ["10.1.0.11:9200, 10.1.0.10:9200"]

That's bad because both hosts are a part of a large string. /var/log/logstash/*log yelps like this:

{:timestamp=>"2016-04-12T22:48:52.374000+0000", :message=>"Error: Host '10.1.0.11:9200, 10.1.0.10:9200' was specified, but is not valid! Use either a full URL or a hostname:port string!", :level=>:error}

The hosts should be individual strings in the array:

["ip:port", "ip:port"] instead of: ["ip:port, ip:port"]

So then I decided to remove an es unit because i figured that would remove one of the hosts from my conf. To my chagrin, I got None:None tacked onto the end of my hosts:

ubuntu@machine-12:~$ grep hosts /etc/logstash/conf.d/*
/etc/logstash/conf.d/beats.conf:    hosts => ["10.1.0.11:9200, 10.1.0.10:9200, None:None"]
/etc/logstash/conf.d/legacy.conf:       hosts => ["10.1.0.11:9200, 10.1.0.10:9200, None:None"]

So I think there's more work needed to handle multiple hosts in the logstash configs.