sfsdf
This commit is contained in:
5
docker/elk/extensions/logspout/Dockerfile
Executable file
5
docker/elk/extensions/logspout/Dockerfile
Executable file
@@ -0,0 +1,5 @@
|
||||
# uses ONBUILD instructions described here:
|
||||
# https://github.com/gliderlabs/logspout/tree/master/custom
|
||||
|
||||
FROM gliderlabs/logspout:master
|
||||
ENV SYSLOG_FORMAT rfc3164
|
||||
28
docker/elk/extensions/logspout/README.md
Executable file
28
docker/elk/extensions/logspout/README.md
Executable file
@@ -0,0 +1,28 @@
|
||||
# Logspout extension
|
||||
|
||||
Logspout collects all Docker logs using the Docker logs API, and forwards them to Logstash without any additional
|
||||
configuration.
|
||||
|
||||
## Usage
|
||||
|
||||
If you want to include the Logspout extension, run Docker Compose from the root of the repository with an additional
|
||||
command line argument referencing the `logspout-compose.yml` file:
|
||||
|
||||
```bash
|
||||
$ docker-compose -f docker-compose.yml -f extensions/logspout/logspout-compose.yml up
|
||||
```
|
||||
|
||||
In your Logstash pipeline configuration, enable the `udp` input and set the input codec to `json`:
|
||||
|
||||
```logstash
|
||||
input {
|
||||
udp {
|
||||
port => 5000
|
||||
codec => json
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
<https://github.com/looplab/logspout-logstash>
|
||||
13
docker/elk/extensions/logspout/build.sh
Executable file
13
docker/elk/extensions/logspout/build.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# source: https://github.com/gliderlabs/logspout/blob/621524e/custom/build.sh
|
||||
|
||||
set -e
|
||||
apk add --update go build-base git mercurial ca-certificates
|
||||
cd /src
|
||||
go build -ldflags "-X main.Version=$1" -o /bin/logspout
|
||||
apk del go git mercurial build-base
|
||||
rm -rf /root/go /var/cache/apk/*
|
||||
|
||||
# backwards compatibility
|
||||
ln -fs /tmp/docker.sock /var/run/docker.sock
|
||||
16
docker/elk/extensions/logspout/logspout-compose.yml
Executable file
16
docker/elk/extensions/logspout/logspout-compose.yml
Executable file
@@ -0,0 +1,16 @@
|
||||
version: '3.2'
|
||||
|
||||
services:
|
||||
logspout:
|
||||
build:
|
||||
context: extensions/logspout
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
environment:
|
||||
ROUTE_URIS: logstash://logstash:5000
|
||||
LOGSTASH_TAGS: docker-elk
|
||||
networks:
|
||||
- elk
|
||||
depends_on:
|
||||
- logstash
|
||||
restart: on-failure
|
||||
10
docker/elk/extensions/logspout/modules.go
Executable file
10
docker/elk/extensions/logspout/modules.go
Executable file
@@ -0,0 +1,10 @@
|
||||
package main
|
||||
|
||||
// installs the Logstash adapter for Logspout, and required dependencies
|
||||
// https://github.com/looplab/logspout-logstash
|
||||
import (
|
||||
_ "github.com/gliderlabs/logspout/healthcheck"
|
||||
_ "github.com/gliderlabs/logspout/transports/tcp"
|
||||
_ "github.com/gliderlabs/logspout/transports/udp"
|
||||
_ "github.com/looplab/logspout-logstash"
|
||||
)
|
||||
Reference in New Issue
Block a user