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