mirror of
https://github.com/vimagick/dockerfiles
synced 2024-06-28 09:41:20 +00:00
add gelf support to ELK
This commit is contained in:
parent
299d84de53
commit
f2ded6291a
@ -35,3 +35,26 @@ actions:
|
|||||||
$ pip install elasticsearch-curator
|
$ pip install elasticsearch-curator
|
||||||
$ curator delete-indices.yml
|
$ 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.
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@ input {
|
|||||||
beats {
|
beats {
|
||||||
port => 5044
|
port => 5044
|
||||||
}
|
}
|
||||||
|
gelf {
|
||||||
|
port => 12201
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output {
|
output {
|
||||||
|
@ -20,6 +20,7 @@ logstash:
|
|||||||
ports:
|
ports:
|
||||||
- "5044:5044"
|
- "5044:5044"
|
||||||
- "9600:9600"
|
- "9600:9600"
|
||||||
|
- "12201:12201/udp"
|
||||||
links:
|
links:
|
||||||
- elasticsearch
|
- elasticsearch
|
||||||
volumes:
|
volumes:
|
||||||
|
Loading…
Reference in New Issue
Block a user