remote_syslog2 icon indicating copy to clipboard operation
remote_syslog2 copied to clipboard

Allow setting both hostname and logfile name in the config

Open DannyBen opened this issue 8 years ago • 0 comments

Following the discussion in #51, I am opening this new suggestion:

Papertrail has two "tags" per entry - the hostname, sometimes referred to as the system name, and the log name, sometimes referred to as the tag.

PR #51 opened my apetite to be able to edit not only the second one (tag), but also the first one.

Then, we will be able to configure like this:

- path: /opt/rails/{{ name }}/log/*.log
  system: {{ name }}

And the output will look like this: ( assuming {{ name }} evaluates to rails01 and rails02 )

timestamp    rails01    crono     event details
timestamp    rails02    crono     event details

instead of

timestamp    rails    rails01_crono     event details
timestamp    rails    rails02_crono     event details

In other words - allow to set hostname per file, and not only globally per actual physical machine.

The rationale is simple:

  1. Assuming the implementation is easy, why not?
  2. It is not uncommon to have more than one 'systems' on the same host. So hostname is a little useless in such cases
  3. It will allow a much simpler configuration for ansible (and other automation tools) - we will be able to use the single wildcard configuration entry, instead of having a line per log file.
  4. Without this feature, the second tag of the log contains information about the system and not the log file. It does not belog there. (e.g. rails rails01_crono is less readable and compact than rails01 crono)

If more clarifications are needed about our use case, I am happy to share more.

DannyBen avatar Feb 20 '16 16:02 DannyBen