MongoDB

Based on the MongoDB destination of the AxoSyslog syslog-ng distribution.

Available in Logging operator version 4.4 and later.

Example

apiVersion: logging.banzaicloud.io/v1beta1
kind: SyslogNGOutput
metadata:
  name: mongodb
  namespace: default
spec:
  mongodb:
    collection: syslog
    uri: "mongodb://mongodb-endpoint/syslog?wtimeoutMS=60000&socketTimeoutMS=60000&connectTimeoutMS=60000"
    value_pairs: scope("selected-macros" "nv-pairs")

For more information, see the documentation of the AxoSyslog syslog-ng distribution.

Configuration

(Batch, required)

Batching parameters

(Bulk, required)

Bulk operation related options

collection (string, required)

The name of the MongoDB collection where the log messages are stored (collections are similar to SQL tables). Note that the name of the collection must not start with a dollar sign ($), and that it may contain dot (.) characters.

dir (string, optional)

Defines the folder where the disk-buffer files are stored.

disk_buffer (*DiskBuffer, optional)

This option enables putting outgoing messages into the disk buffer of the destination to avoid message loss in case of a system failure on the destination side. For details, see the Syslog-ng DiskBuffer options.

Default: false

log-fifo-size (int, optional)

The number of messages that the output queue can store.

persist_name (string, optional)

If you receive the following error message during syslog-ng startup, set the persist-name() option of the duplicate drivers: Error checking the uniqueness of the persist names, please override it with persist-name option. Shutting down. See the documentation of the AxoSyslog syslog-ng distribution for more information.

retries (int, optional)

The number of times syslog-ng OSE attempts to send a message to this destination. If syslog-ng OSE could not send a message, it will try again until the number of attempts reaches retries, then drops the message.

time_reopen (int, optional)

The time to wait in seconds before a dead connection is reestablished.

Default: 60

uri (*secret.Secret, optional)

Connection string used for authentication. See the documentation of the AxoSyslog syslog-ng distribution

Default: mongodb://127.0.0.1:27017/syslog?wtimeoutMS=60000&socketTimeoutMS=60000&connectTimeoutMS=60000

value_pairs (ValuePairs, optional)

Creates structured name-value pairs from the data and metadata of the log message.

Default: "scope("selected-macros" "nv-pairs")"

write_concern (RawString, optional)

Description: Sets the write concern mode of the MongoDB operations, for both bulk and single mode. For details, see the documentation of the AxoSyslog syslog-ng distribution.

Bulk

Bulk operation related options. For details, see the documentation of the AxoSyslog syslog-ng distribution.

bulk (*bool, optional)

Enables bulk insert mode. If disabled, each messages is inserted individually.

Default: yes

bulk_bypass_validation (*bool, optional)

If set to yes, it disables MongoDB bulk operations validation mode.

Default: no

bulk_unordered (*bool, optional)

Description: Enables unordered bulk operations mode.

Default: no

ValuePairs

TODO move this to a common module once it is used in more places

exclude (RawString, optional)

key (RawString, optional)

pair (RawString, optional)

scope (RawString, optional)