[syslog-ng] use loggen to insert content of a file into local log file

Fabien Wernli wernli at in2p3.fr
Thu Mar 7 08:03:34 UTC 2019


On Wed, Mar 06, 2019 at 01:35:02PM +0000, Lin, Victor wrote:
>   Could anyone can give an example of using loggen to insert content of a file into  a local log file ?

you could use loggen to send to a specific port, on which syslog-ng would be
listening, then create a log statement sendîng to that file, e.g. off the
top of my head:

log {
  source {
    syslog(
      port(1234)
    );
  };
  destination {
    file(
      '/tmp/loggen.log'
    );
  };
};

loggen -D "blah blah blah" localhost 1234



More information about the syslog-ng mailing list