I am building a docker image to run filebeat which will via a shared volume harvest all the log files output from the other services running in containers on the host. However, it appears to hang on startup. Relevant file content below. I have confirmed that the path to the log file is available as is ELS on port 9200.
DOCKERFILE:
FROM ubuntu:trusty
RUN mkdir /filebeat
WORKDIR /filebeat
RUN apt-get update
RUN apt-get install -y wget
RUN wget https://download.elastic.co/beats/filebeat/filebeat_1.3.0_amd64.deb
RUN dpkg -i filebeat_1.3.0_amd64.deb
COPY ./filebeat.yml /filebeat/filebeat.yml
COPY ./start_filebeat.sh /filebeat/start_filebeat.sh
RUN chmod +x /filebeat/start_filebeat.sh
CMD /filebeat/start_filebeat.sh
START_FILEBEAT.SH
#!/usr/bin/env bash
echo "Waiting 10s to allow deployer to interrupt"
sleep 10
if [ -f /mnt/mesos/sandbox/filebeat.yml ]; then
echo "Copying config files from mesos sandbox..."
rm -rf ./filebeat.yml
ln -s /mnt/mesos/sandbox /filebeat
fi
echo "Using config ..."
cat /filebeat/filebeat.yml
echo "Starting ..."
filebeat -e -c /filebeat/filebeat.yml
FILEBEAT.YML
filebeat:
prospectors:
-
paths:
- /mnt/logshr/*.log
input_type: log
registry_file: /var/lib/filebeat/registry
output:
elasticsearch:
hosts: ["192.168.99.100:9200"]
shipper:
logging:
to_syslog: false
to_files: false