fluentd container logging to loggly.

This commit is contained in:
2017-10-24 22:47:45 -04:00
parent 2287ce73a5
commit 227a958f8e
18 changed files with 158 additions and 4 deletions

View File

@@ -0,0 +1,17 @@
FROM fluent/fluentd:v0.14-onbuild
MAINTAINER Richard Morgan <r_morgan@sympatico.ca>
RUN apk add --update --virtual .build-deps \
sudo build-base ruby-dev \
# cutomize following instruction as you wish
&& sudo gem install \
fluent-plugin-secure-forward \
fluent-plugin-loggly \
&& sudo gem sources --clear-all \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* \
/home/fluent/.gem/ruby/2.3.0/cache/*.gem
EXPOSE 24224

View File

@@ -0,0 +1,36 @@
---
# Based on https://hub.docker.com/r/fluent/fluentd/
#
# DOCKER_HOST=192.168.2.41:2376 docker-compose up -d
#
# docker login dkregistry.xai-corp.net:5000
# docker-compose build && docker push dkregistry.xai-corp.net:5000/fluentd:latest
# DOCKER_HOST=dkhost:2376 docker stack deploy --with-registry-auth -c docker-compose.yml services
# DOCKER_HOST=dkhost:2376 docker stack ps services
version: '3'
services:
fluentd:
build:
context: ""
dockerfile: Dockerfile
image: "dkregistry.xai-corp.net:5000/fluentd:latest"
volumes:
- /opt/shared/logs:/fluentd/log
ports:
- "24224:24224"
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: any
delay: "1s"
max_attempts: 3
resources:
limits:
cpus: '0.5'
memory: 64M

View File

@@ -0,0 +1,10 @@
<source>
@type forward
@id input1
port 24224
</source>
<match **>
@type loggly
loggly_url https://logs-01.loggly.com/inputs/22feaabc-c080-4407-86c3-ae9052999786/tag/fluentd
</match>