afmongodb [1]

The afmongodb module has only one driver, that is the mongodb() destination driver. The mongodb() driver sends messages to a MongoDB database.

Important Information

The syslog-ng OSE mongodb() driver is compatible with MongoDB server version 1.4 and newer. Using mongo() without any parameters uses the following default values:

destination d_mongodb {
    mongodb(
        uri("mongodb://localhost:27017/syslog")
        collection("messages")
        value-pairs(
            scope("selected-macros" "nv-pairs" "sdata")
        )
    );
};

Status

Architecture

Status

x86

Works

ARM

Works

Testing

From the default values, we can see that mongodb() driver sends the messages to a database named syslog, so to test this driver we first need to set up mongodb to receive these messages. To do so,

  • Install MongoDB

  • Create a database called syslog by entering the command:

    • mongosh syslog

  • Set up the database like so:

    • db.createCollection( "messages", { capped: true, size: 100000000 } )

  • Once the messages have been transmitted, to view us:

    • db.messages.find().pretty()

Configuration file used

Proof

Testing mongodb() driver on macOS (x86)
Testing mongodb() driver on macOS (ARM)

Last updated

Was this helpful?