@qrpike Are you still having this issue?
I had this issue and I tracked it down the my logspout/logstash images not playing nice with the each other.
Here is what I did to fix it.
I replaced my logspout image with the docker compose file below. (I just replaced the rancher image with a community supported image of logspout-logstash. Of course there are not as many modules installed as the rancher one but it pushes to logstash over udp which is all I need at the moment.
Try this first
Delete your logspout stack > create a new one with the name logspout
> insert the docker/rancher-compose.ymls below
docker-compose.yml
logspout:
restart: always
environment:
ROUTE_URIS: 'logstash://logstash:5000'
LOGSPOUT: 'ignore'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
external_links:
- logstash/logstash-collector:logstash
labels:
io.rancher.scheduler.global: 'true'
io.rancher.container.hostname_override: container_name
tty: true
image: amouat/logspout-logstash:latest
stdin_open: true
rancher-compose.yml
{}
Test your indexer. (I just restarted my redis and indexer instance because all the logs had backed up in redis and they keep blowing up in the indexer logs)
If this solved your issue then Great stop here. If you see a new error that you have never seen before try the below.
Upgrade the Logstash instances to version 2.4.
Here are my docker-compose and rancher-compose files for the logstash upgrade.
Take note the only real change to the files are the image for the collector and indexer to image: logstash:2.4
Also I had to change the elasticsearch
output in the rancher-compose file to account for breaking change introduced in logstash 2.0. (just change host
to hosts
and I deleted some extra fluff that is now default values in v2.0 and greater ) You can read more about the breaking changes here: https://www.elastic.co/guide/en/logstash/2.4/breaking-changes.html
docker-compose.yml
logstash-indexer-config:
restart: always
image: rancher/logstash-config:v0.2.0
labels:
io.rancher.container.hostname_override: container_name
redis:
restart: always
tty: true
image: redis:3.0.3
stdin_open: true
labels:
io.rancher.container.hostname_override: container_name
logstash-indexer:
restart: always
tty: true
volumes_from:
- logstash-indexer-config
command:
- logstash
- -f
- /etc/logstash
image: logstash:2.4
links:
- redis:redis
external_links:
- es/elasticsearch-clients:elasticsearch
stdin_open: true
labels:
io.rancher.sidekicks: logstash-indexer-config
io.rancher.container.hostname_override: container_name
logstash-collector-config:
restart: always
image: rancher/logstash-config:v0.2.0
labels:
io.rancher.container.hostname_override: container_name
logstash-collector:
restart: always
tty: true
links:
- redis:redis
ports:
- "5000/udp"
volumes_from:
- logstash-collector-config
command:
- logstash
- -f
- /etc/logstash
image: logstash:2.4
stdin_open: true
labels:
io.rancher.sidekicks: logstash-collector-config
io.rancher.container.hostname_override: container_name
rancher-compose.yml
logstash-indexer:
metadata:
logstash:
inputs: |
redis {
host => "redis"
port => "6379"
data_type => "list"
key => "logstash"
}
filters: |
if [docker.name] == "/rancher-server" {
json {
source => "message"
}
kv {}
if [@message] {
mutate {
replace => { "message" => "%{@message}" }
}
}
}
outputs: |
elasticsearch {
hosts => "elasticsearch"
index => "logstash-%{+YYYY.MM.dd}"
}
logstash-collector:
metadata:
logstash:
inputs: |
udp {
port => 5000
codec => "json"
}
outputs: |
redis {
host => "redis"
port => "6379"
data_type => "list"
key => "logstash"
}
Let me know if this worked for you.