Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.45k stars 1.07k forks source link

Sidecar Collector creates duplicated nxlog settings #4441

Closed rphlwnk closed 6 years ago

rphlwnk commented 6 years ago

Expected Behavior

I configured two seperate collectors, one for dhcp logs and one for printserver logs. When i set both tags on one client both collectors should merge together in one nxlog.config file.

Current Behavior

Both merges together nicely, but both are creating the default nxlog snippets and so nxlog wont start. Here is the config: https://pastebin.com/gmMkY3JH

Possible Solution

Check if another tag is applied and only set one nxlog standard setting.

Steps to Reproduce (for bugs)

  1. Create two seperate collector configurations
  2. Set both on one sidecar

Context

I need two seperate tags, because on one location i have print and dhcp on one server, and on another i have it on seperate servers. If it is not a bug/issue i have to create extra collectors, one with print and dhcp, one with dhcp and one with printserver.

Your Environment

mariussturm commented 6 years ago

@empfangsfehler the default snippet is added to a configuration at creation time as a convenient function. If you merge two configurations you can simply delete one of the default snippets. Latest version of the Sidecar should detect if you keep both and ignore one of the identical snippets: https://github.com/Graylog2/collector-sidecar/blob/master/backends/nxlog/configuration.go#L145