[syslog-ng] How to enable Syslog-ng authentication with MongoDB

Ibrahim Al Mahfooz ibrahim.nezar at sevennet.net
Tue Aug 15 13:38:35 UTC 2023


Hi,

I would like to harden the security by enabling authentication between
syslog-ng and MongoDB.

I'm using syslog-ng v3.38 and MongoDB v6.0.8

At the destination I tried the below two methods but none of themt worked,
am I doing something wrong? Or the authentication is not supported?

*---> First method:*
destination d_mongodb_01 {
mongodb(
uri("mongodb://SampleUser:SamplePass@172.16.17.16:27017/syslog-ng_01")
collection("logs")
value-pairs(
pair("datetime" "${S_ISODATE}")
pair("privateip" "${privateip}")
pair("portstatus" "${PORTSTATUS}")
pair("host" "${HOST}"))
);
};

*---> Second method:*
destination d_mongodb_01 {
mongodb(
uri("mongodb://172.16.17.16:27017/syslog-ng_01")
username("SampleUser")
password("SamplePass")
collection("logs")
value-pairs(
pair("datetime" "${S_ISODATE}")
pair("privateip" "${privateip}")
pair("portstatus" "${PORTSTATUS}")
pair("host" "${HOST}"))
);
};

Appreciate your help

Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.balabit.hu/pipermail/syslog-ng/attachments/20230815/a070de33/attachment.htm>


More information about the syslog-ng mailing list