umputun / docker-logger

Logs collector for docker
MIT License
246 stars 37 forks source link

Options INCLUDE_PATTERN and EXCLUDE_PATTERN don't take effect #24

Open Lion-son opened 3 years ago

Lion-son commented 3 years ago

Hello I'm using docker image umputun/docker-logger:latest "Created": "2019-06-18T17:22:53.675688126Z" "Image": "sha256:ceb65856493ad141b17534346a21f357513852f852c8e5fb4524b12ae54e2f6d"

Trying to configure includes to have only specific containers, but option INCLUDE_PATTERN seems doesn't work More over, the option EXCLUDE_PATTERN seems does not work also

Now I have BOTH options configured simultaneously in .yml file and the service doesn't reports any error or warning. It looks like it completelly ignores them and collects logs for all running containers

Current configuration

        environment:
            - INCLUDE_PATTERN="ib.*"
            - EXCLUDE_PATTERN="docker-logger"

docker logs docker-logger

2020/11/11 12:48:39.251 [INFO] {app/main.go:63 main.main} options: {DockerHost:unix:///var/run/docker.sock EnableSyslog:false SyslogHost:127.0.0.1:514 SyslogPrefix:docker/ EnableFiles:true MaxFileSize:10 MaxFilesCount:5 MaxFilesAge:10 MixErr:true FilesLocation:logs Excludes:[] Includes:[] ExtJSON:false Dbg:true} 2020/11/11 12:48:39.251 [DEBUG] {discovery/events.go:40 discovery.NewEventNotif} create events notif, excludes: [], includes: [] 2020/11/11 12:48:39.260 [DEBUG] {discovery/events.go:112 discovery.(*EventNotif).emitRunningContainers} total containers = 17 ... 2020/11/11 12:48:39.261 [DEBUG] {app/main.go:116 main.runEventLoop.func1} streaming for 17 containers

umputun commented 3 years ago

More over, the option EXCLUDE_PATTERN seems does not work

There is no such option. It is not listed in the list of params in README and not supported

Lion-son commented 3 years ago

There is no such option. It is not listed in the list of params in README and not supported

I'm sorry for misunderstanding with EXCLUDE_PATTERN

jeffothy commented 3 years ago

Hi @umputun, it appears that docker-logger:latest has not been bumped with the most recent change in master. The log output from @Lion-son matches the previous rev's line numbers.

Are you able to build and push that tag to docker hub?

umputun commented 3 years ago

apparently, I have never relesed it, so the image was :master, not :latest I have added a release v1.3.0 and the docker hub will build it in a few minutes. @Lion-son pls check as ready and let us know.

Lion-son commented 3 years ago

apparently, I have never relesed it, so the image was :master, not :latest I have added a release v1.3.0 and the docker hub will build it in a few minutes. @Lion-son pls check as ready and let us know.

Yes, now the optionn INCLUDE_PATTERN works as expected Thank you for fast release of the feature

docker-logger v1.3.0-0ffe618-20201111T12:36:55 2020/11/12 04:28:01.006 [INFO] {app/main.go:65 main.main} options: {DockerHost:unix:///var/run/docker.sock EnableSyslog:false SyslogHost:127.0.0.1:514 SyslogPrefix:docker/ EnableFiles:true MaxFileSize:10 MaxFilesCount:5 MaxFilesAge:10 MixErr:true FilesLocation:logs Excludes:[] Includes:[] IncludesPattern:^ib. ExtJSON:false Dbg:true} 2020/11/12 04:28:01.006 [DEBUG] {discovery/events.go:41 discovery.NewEventNotif} create events notif, excludes: [], includes: [], includesPattern: ^ib. 2020/11/12 04:28:01.013 [DEBUG] {discovery/events.go:124 discovery.(EventNotif).emitRunningContainers} total containers = 18 ... 2020/11/12 04:28:01.014 [DEBUG] {discovery/events.go:139 discovery.(EventNotif).emitRunningContainers} running container added, {ContainerID:84b21290d19865b5502786a65d38c43667df2fcb3276263be3ff847ab570e023 ContainerName:ib_specific-service_1 Group:ib TS:1970-01-19 13:52:15 +0000 UTC Status:true} 2020/11/12 04:28:01.014 [INFO] {discovery/events.go:129 discovery.(EventNotif).emitRunningContainers} container filebeat excluded 2020/11/12 04:28:01.014 [INFO] {discovery/events.go:129 discovery.(EventNotif).emitRunningContainers} container logstash excluded ... 2020/11/12 04:28:01.015 [DEBUG] {app/main.go:129 main.runEventLoop.func1} streaming for 14 containers