7.8. mongodb: Storing messages in a MongoDB database
mongodb() driver sends messages to a MongoDB database. MongoDB is a schema-free, document-oriented database. For the list of available optional parameters, see Section 7.8.2, mongodb() destination options.
In order to use this destination, syslog-ng Premium Edition must run in server mode. Typically, only the central syslog-ng Premium Edition server uses this destination. For details on the server mode, see Section 2.3.3, Server mode.
mongodb() driver does not support creating indexes, as that can be a very complex operation in MongoDB. If needed, the administrator of the MongoDB database must ensure that indexes are created on the collections.
mongodb() driver does not add the
_id field to the message: the MongoDB server will do that automatically, if none is present. If you want to override this field from syslog-ng PE, use the
key() parameter of the
The syslog-ng PE
mongodb() driver is compatible with MongoDB server version 1.4 and newer.
By default, syslog-ng PE handles every message field as a string. For details on how to send selected fields as other types of data (for example, handle the PID as a number), see Section 2.12.1, Specifying data types in value-pairs.