Dear Michael,
thank you for the log message example! I putted it into a file called "message.json"
I had to strip down your config (not tls, no `scl-root`, etc.). After that I started up a syslog-ng with this minimal config:
@version: 3.5
@include "scl.conf"
template unitManagerTemplate {
template("$(format-json --scope dot-nv-pairs) [sdid@123456 X-OVH-TOKEN=\"XXXXXXXXXXXXXXXXXXXXXXXXXX\"\n");
};
parser p_json {
json-parser(prefix(".json."));
};
destination ovhPaaSLogs {
tcp("127.0.0.1"
port(6514),
template(unitManagerTemplate),
);
};
source s_net {
file("/source/message.json"
flags(no-parse)
);
};
log {
source(s_net);
parser(p_json);
destination(ovhPaaSLogs);
};
And I got the following output: (started syslog-ng with the following command: /install/sbin/syslog-ng -Fdev -f /source/syslog-ng.conf)
[2018-10-18T08:27:49.450914] Incoming log entry; line='{"level":"error","message":"connection ended without disconnect receipt","timestamp":"2018-10-12T17:49:08.650Z"}'
[2018-10-18T08:27:49.451015] LogSource window is empty;
[2018-10-18T08:27:49.451076] Outgoing message; message='{"_json":{"timestamp":"2018-10-12T17:49:08.650Z","message":"connection ended without disconnect receipt","level":"error"}} [sdid@123456 X-OVH-TOKEN="XXXXXXXXXXXXXXXXXXXXXXXXXX"\x0a'
The destination in an another window:
{"_json":{"timestamp":"2018-10-12T17:49:08.650Z","message":"connection ended without disconnect receipt","level":"error"}} [sdid@123456 X-OVH-TOKEN="XXXXXXXXXXXXXXXXXXXXXXXXXX"
note: The paths (/install, /source, etc.) are coming from the fact I am using dbld (
https://github.com/balabit/syslog-ng/tree/master/dbld), you might want to try it, to eliminate any environment effects. If it works, than we can compare your environment with dbld for differences.
Br,
Laci