add support to forward logs to ELK stack.

This commit is contained in:
Pablo Castorino 2016-09-23 16:02:30 -03:00
parent c2eb975ace
commit e08d7c2e19
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,34 @@
version: '2'
services:
mail:
image: tvial/docker-mailserver:v2
hostname: mail
domainname: domain.com
container_name: mail
links:
- elk
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
volumes:
- maildata:/var/mail
- ./config/:/tmp/docker-mailserver/
environment:
- ENABLE_FAIL2BAN=1
- ENABLE_ELK=1
cap_add:
- NET_ADMIN
elk:
build elk
ports:
- "5601:5601"
- "9200:9200"
- "5044:5044"
- "5000:5000"
volumes:
maildata:
driver: local

View File

@ -354,6 +354,14 @@ if [ "$ONE_DIR" = 1 -a -d $statedir ]; then
fi
done
fi
if [ "$ENABLE_ELK" = 1 ]; then
ELK_PORT=${ELK_PORT:="10514"}
ELK_HOST=${ELK_HOST:="elk"}
echo "forward logs to ELK ($ELK_HOST:$ELK_PORT)"
echo " *.* @$ELK_HOST:$ELK_PORT " > /etc/rsyslog.d/60-elk.conf
else
rm -f /etc/rsyslog.d/60-elk.conf
fi
echo "Starting daemons"
cron