I would like to send postgres connection logs to the OVH Logs Data Platform service with syslog-ng. How should syslog-ng be configured to send these logs?
Currently I have the following configuration in the ldp.conf file:
source s_postgres {
file("/var/log/postgresql/postgresql-${YEAR}-${MONTH}-${DAY}_000000.log" flags(no-parse));
}
template t_postgres {
template("<${LEVEL_NUM}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} - [sdid X-OVH-TOKEN=\"\" pid=\"${PID}\" facility=\"${FACILITY}\" priority=\"${PRIORITY}\"]$
template_escape(no);
}
d_postgres {
tcp(".logs.ovh.com"
port(12201)
tls(ca_dir("/etc/ssl/certs"))
ts_format("rfc3339") template(t_postgres)
keep-alive(yes)
so_keepalive(yes)
log-fifo-size(30000)
);
}
log {
source(s_postgres);
destination(d_postgres);
}
AI and Machine Learning - Syslog-ng and postgresql connection logs
Related questions
- Could not connect to remote process. Aborting debug session. Attach Debugger OK button
2936
19.06.2021 06:47
- Changing my VAT EU no
2618
13.06.2022 09:38
- Connect to MYSQL in OVH cloud, with python that consisted of SSH possibility
2036
11.03.2021 09:46
- Chatbot and rasa python library
1795
09.05.2021 09:12
- I can't find my country in the contact details!
1783
12.12.2021 20:02
- About the AI Training category
1749
08.12.2020 16:21
- Ovhai CLI : Deserialize error
1719
11.06.2021 13:29
- About the Discuss AI category
1609
08.12.2020 16:20
- POST on an Object Storage
1517
27.10.2022 14:30
In order to log RFC 5424 syslogs to Logs Data Platform, you must use the appropriate port. The Port for RFC 5424 is 6514. You can find an example of the syslog-ng configuration at the following Official Documentation:
https://docs.ovh.com/fr/logs-data-platform/how-to-log-your-linux/
For your configuration, your are mostly interested in this part of the documentation (for syslog-ng 3.8+, note also the timestamp format).
destination ovhPaaSLogs {
network(".logs.ovh.com"
port(6514),
template(ovhTemplate),
ts_format("iso"),
transport("tls"),
tls(peer-verify("required-trusted") ca_dir("/etc/ssl/certs/")),
keep-alive(yes),
so_keepalive(yes),
);
};
The documentation provides also an example https://www.tommypetarabic.com/ Website of a working template, and other guides will give you alternatives.
Don't hesitate do reach directly the OVH team if you need further assistance at: