diff --git a/elk/README.md b/elk/README.md index 6ea0608..7cae774 100644 --- a/elk/README.md +++ b/elk/README.md @@ -35,3 +35,26 @@ actions: $ pip install elasticsearch-curator $ curator delete-indices.yml ``` + +## Send container's log to ELK + +```nginx +input { + gelf { + port => 12201 + } +} +``` + +```yaml +test: + image: alpine + command: 'sh -c "while :; do date; sleep 1; done"' + log_driver: gelf + log_opt: + gelf-address: udp://x.x.x.x:12201 + tag: test +``` + +Search `tag: test` in kibana to show recent logging. + diff --git a/elk/data/pipeline/logstash.conf b/elk/data/pipeline/logstash.conf index e5e15c4..dc8fd83 100644 --- a/elk/data/pipeline/logstash.conf +++ b/elk/data/pipeline/logstash.conf @@ -2,6 +2,9 @@ input { beats { port => 5044 } + gelf { + port => 12201 + } } output { diff --git a/elk/docker-compose.yml b/elk/docker-compose.yml index 2ce4fee..0384626 100644 --- a/elk/docker-compose.yml +++ b/elk/docker-compose.yml @@ -20,6 +20,7 @@ logstash: ports: - "5044:5044" - "9600:9600" + - "12201:12201/udp" links: - elasticsearch volumes: