<div dir="ltr"><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default">Hello,<br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default">I have integration working fine between syslog-ng v3.38 and MongoDB v6. I am working to enable MongoDB Time-Series Collections on a testing DB for the purpose of having better efficiency and improved queries over time. <br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default">I created the DB and collection, tested it by Mongo Compass client, then I tried to send the data from syslog-ng but it didn't work. MongoDB is throwing the following error: <br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default">"17:12:57. 483 | [2023-08-06T17:12:57.355549] Failed to insert into MongoDB; time_reopen='10', reason='\'datetime\' must be present and contain a valid BSON UTC datetime value', driver='d_mongodb_ttl#0" <br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default">
<div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default">My
understanding is that it is a must to send
the time/date to MongoDB with Time Series enabled DB a BSON format Date. Any suggestions?<br></div>
</div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default"><u>Below is the mongoDB destination config:</u></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default">destination d_mongodb_ttl {<br> mongodb(<br> uri("mongodb://<a href="http://192.168.1.19:27017/syslog-ng_ttl">192.168.1.19:27017/syslog-ng_ttl</a>")<br> collection("logs")<br> value-pairs(<br> scope("selected-macros")<br> exclude("SOURCEIP")<br> exclude("TAGS")<br> pair("datetime" "${S_ISODATE}")<br> pair("privateip" "${privateip}")<br> pair("publicip" "${publicip}")<br> pair("publicportrange" "${publicportrange}")<br> pair("portaction" "${AI}")<br> pair("portstatus" "${AL}")<br> pair("host" "${HOST}"))<br> );<br>};</div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default">Appreciate your help<br></div><div style="font-family:tahoma,sans-serif;color:rgb(7,55,99)" class="gmail_default"><br></div><br></div>