2
responses

What I'm trying to achive is to have a few Values globaly defined and the should be automatically added to all inputs.
Ie the same thing as Global Tags in Telegraf

Today I first use a define statement in the global part of NXLog.conf

Define Company Acme 

 

For each input I define i have to add a Exec line

Exec $Company = '%Company%';

I would like to be able to do this only once and have it automatically appended to all inputs. For a multi Company Scenario with a lot of logfiles It gets rather messy to maintain when you need to add anoter global value. It works well in Telegraf so I would like to be able to do something similar in Nxlog

 

AskedSeptember 29, 2017 - 1:32pm

Answer (1)

This is not currently possible. On the other hand if you have a lot of separate input module instances it would probably make more sense to generate your config or do something like this:

define COMPANY foo
include company-input.conf

define COMPANY bar
include company-input.conf

Then you only have to edit stuff in company-input.conf once.

Comments (1)

  • mats's picture

    Yes that would work if we only had one config per customer. 

    The problem is that we don't. 
    We want to have a model where each app adds it's own log-config.
    to awoid having a lot of editing of nxlog.conf we use the include feature to point to a "plug-in" directory where each app can put their log.conf 

    Therefore we will have 5 to maybee 10 conf files on each server.