Skip to content

Custom container/access log file (fail2ban) #54

Answered by ckulka
Glareascum asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Glareascum , do you use Nginx or Apache and can you use the container logs, or do you need the actual access log files?

Assuming fail2ban can not consume container logs out of the box, I can think of three solutions:

Consume container JSON log files

The access log is printed to the container logs, are stored in /var/lib/docker/containers/<container id>/<container id>-json.log unless you changed your logging driver, e.g. to journald (something I would personally actually recommend, it helps with disk space filling up with log files).

The container id changes every time you start a new one, so I don't know if you can just consume all container logs and filter in fail2ban, or if fail2ban…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Glareascum
Comment options

@ckulka
Comment options

@Glareascum
Comment options

Answer selected by ckulka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #53 on January 13, 2022 18:32.