Use this documentation with care! It describes the outdated version 7, which was actively developed around 2014 and is considered dead by the rsyslog team.

This documentation reflects the latest update of the v7-stable branch. It describes the 7.6.8 version, which was never released. As such, it contains some content that does not apply to any released version.

To obtain the doc that properly matches your installed v7 version, obtain the doc set from your distro. Each version of rsyslog contained the version that exactly matches it.

As general advise, it is strongly suggested to upgrade to the current version supported by the rsyslog project. The current version can always be found on the right-hand side info box on the rsyslog web site.

Note that there is only limited rsyslog community support available for the outdated v7 version (officially we do not support it at all, but we usually are able to answer simple questions). If you need to stick with v7, it probably is best to ask your distribution for support.

ommongodb: MongoDB Output Module

Module Name:    ommongodb

Author:Rainer Gerhards <rgerhards@adiscon.com>

Description:

This module provides native support for logging to MongoDB.

Action Parameters:

  • server Name or address of the MongoDB server
  • serverport Permits to select a non-standard port for the MongoDB server. The default is 0, which means the system default port is used. There is no need to specify this parameter unless you know the server is running on a non-standard listen port.
  • db Database to use
  • collection Collection to use
  • uid logon userid used to connect to server. Must have proper permissions.
  • pwd the user’s password
  • template Template to use when submitting messages.

Note rsyslog contains a canned default template to write to the MongoDB. It will be used automatically if no other template is specified to be used. This template is:

template(name=”BSON” type=”string” string=”"sys" : "%hostname%", "time" : "%timereported:::rfc3339%", "time_rcvd" : "%timegenerated:::rfc3339%", "msg" : "%msg%", "syslog_fac" : "%syslogfacility%", "syslog_server" : "%syslogseverity%", "syslog_tag" : "%syslogtag%", "procid" : "%programname%", "pid" : "%procid%", "level" : "%syslogpriority-text%"”)

This creates the BSON document needed for MongoDB if no template is specified. The default schema is aligned to CEE and project lumberjack. As such, the field names are standard lumberjack field names, and not rsyslog property names. When specifying templates, be sure to use rsyslog property names as given in the table. If you would like to use lumberjack-based field names inside MongoDB (which probably is useful depending on the use case), you need to select fields names based on the lumberjack schema. If you just want to use a subset of the fields, but with lumberjack names, you can look up the mapping in the default template. For example, the lumberjack field “level” contains the rsyslog property “syslogpriority-text”.

Sample:

The following sample writes all syslog messages to the database “syslog” and into the collection “log” on mongoserver.example.com. The server is being accessed under the account of “user” with password “pwd”.

module(load="ommongodb")
action(type="ommongodb"
       server="mongoserver.example.com" db="syslog" collection="log"
       uid="user" pwd="pwd")

This documentation is part of the rsyslog project. Copyright © 2008-2014 by Rainer Gerhards and Adiscon. Released under the ASL 2.0.

Previous topic

ommail: Mail Output Module

Next topic

ommysql: MySQL Database Output Module

This Page