mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
put worker log to ELK
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -19,6 +19,8 @@
|
||||
# Exclude configuration folder exception the configuration sample file
|
||||
/config
|
||||
!/config/configuration.sample.yml
|
||||
!/config/filebeat.yml
|
||||
!/config/logstash.conf
|
||||
|
||||
# Exclude generated proxies from doctrine2
|
||||
#/resources/proxies
|
||||
|
9
config/filebeat.yml
Normal file
9
config/filebeat.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
filebeat:
|
||||
inputs:
|
||||
- type: log
|
||||
enabled: true
|
||||
paths:
|
||||
- /var/alchemy/Phraseanet/logs/task_*.log
|
||||
- /var/alchemy/Phraseanet/logs/worker_service*.log
|
||||
output.logstash:
|
||||
hosts: ["logstash:5044"]
|
36
config/logstash.conf
Normal file
36
config/logstash.conf
Normal file
@@ -0,0 +1,36 @@
|
||||
input {
|
||||
beats {
|
||||
port => 5044
|
||||
}
|
||||
}
|
||||
filter {
|
||||
clone {
|
||||
clones => ["to_stdout"]
|
||||
}
|
||||
|
||||
if [type] == "to_stdout" {
|
||||
#display only message field in the logstash stdout
|
||||
prune {
|
||||
whitelist_names => ["message"]
|
||||
}
|
||||
mutate {
|
||||
add_field => { "[@metadata][type]" => "to_stdout" }
|
||||
}
|
||||
}
|
||||
else {
|
||||
mutate {
|
||||
add_field => { "[@metadata][type]" => "to_elasticsearch" }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
output {
|
||||
if [@metadata][type][1] == "to_stdout" {
|
||||
stdout {
|
||||
codec => rubydebug
|
||||
}
|
||||
}
|
||||
else {
|
||||
elasticsearch { hosts => ["elasticsearch:9200"] }
|
||||
}
|
||||
}
|
@@ -91,6 +91,30 @@ services:
|
||||
image: kibana:4.6.6
|
||||
ports:
|
||||
- 5601:5601
|
||||
links:
|
||||
- elasticsearch
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
|
||||
logstash:
|
||||
image: logstash:7.6.2
|
||||
links:
|
||||
- elasticsearch
|
||||
volumes:
|
||||
- ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw
|
||||
command: logstash -f /var/alchemy/Phraseanet/config/logstash.conf
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
restart: on-failure
|
||||
|
||||
filebeat:
|
||||
hostname: filebeat
|
||||
image: "docker.elastic.co/beats/filebeat:7.6.2"
|
||||
volumes:
|
||||
- ${PHRASEANET_CONFIG_DIR}/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
|
||||
- ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:ro
|
||||
command: filebeat run -e --strict.perms=false
|
||||
restart: on-failure
|
||||
|
||||
networks:
|
||||
default:
|
||||
|
Reference in New Issue
Block a user