add ELK support#331
Conversation
tomav
left a comment
There was a problem hiding this comment.
I had a first try and here are my feedbacks.
Also, when I go to Kibana, I see No default index pattern. You must select or create one to continue.
How can we I get it configured?
| cap_add: | ||
| - NET_ADMIN | ||
| elk: | ||
| build elk |
There was a problem hiding this comment.
Should be build: elk.
Got this error without :
ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
| RUN mkdir /etc/logstash/patterns.d | ||
| RUN curl -L https://raw.githubusercontent.com/whyscream/postfix-grok-patterns/master/postfix.grok > /etc/logstash/patterns.d/postfix.grok | ||
| RUN curl -L https://raw.githubusercontent.com/whyscream/postfix-grok-patterns/master/50-filter-postfix.conf > /etc/logstash/conf.d/15-filter-postfix.conf | ||
|
|
There was a problem hiding this comment.
added Amavis and Dovecot, but crash geoip plugin fail. working on..
| fi | ||
| done | ||
| fi | ||
| if [ "$ENABLE_ELK" = 1 ]; then |
There was a problem hiding this comment.
I would name it ENABLE_ELK_FORWARDER.
Without forwarder, we can think that it launches ELK stack.
| 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 |
There was a problem hiding this comment.
No filebeat client? (I'm not an ELK expert but it seemed the recommended way to forward logs last time I checked)
There was a problem hiding this comment.
i try use the resources that have mailserver image, but i will try add firebeat client
There was a problem hiding this comment.
It's an open question, don't worry. If it works without, let's try like that.
| if [ "$ENABLE_ELK" = 1 ]; then | ||
| ELK_PORT=${ELK_PORT:="10514"} | ||
| ELK_HOST=${ELK_HOST:="elk"} | ||
| echo "forward logs to ELK ($ELK_HOST:$ELK_PORT)" |
There was a problem hiding this comment.
Message should be more explicit like:
Enabling log forwarding to ELK ($ELK_HOST:$ELK_PORT)
|
@castorinop Great work! |
|
Let me know regarding the first comment:
Thanks. |
|
Steps:
TODO: a way to configure at startup. |
add dovecot grok add geoip db add logstash geoip plugin
|
Strange build error. Restarted it. |
|
Thanks, just tried and amavis entries get tag |
|
I modified the amavis pattern like the following: Can you try? |
|
I tested. Amavis logs are now caught by Logstash. Other point in the elk log, I see sometimes this error: |
|
Same duplicates with postfix grok. (dovecot doesn't seem to be affected): |
add template config replace rsyslog with filebeat.
|
I guess that duplicate logs problem is syslog related. |
|
Restarted timed out build. |
|
Oh yeah, works great! Congrats @castorinop. This is not blocking, so I'll merge this PR. The last missing thing, if a Wiki entry regarding ELK. I'll create 2 new issues to log. Thanks again for your work! |
* add support to forward logs to ELK stack. * from docker elk customize image with * https://github.com/whyscream/postfix-grok-patterns * custom imput * override syslog filter. * fix typo. * Explicit forwarder vars and messages. * add amavis grok * add dovecot grok * add geoip db * add logstash geoip plugin * add custom amavis grok from @tomav. * switch to filebeats input * refactor syslog filter * add filebeat * add template config * replace rsyslog with filebeat.
Uh oh!
There was an error while loading. Please reload this page.