Amazon S3 (om_amazons3)
Amazon Simple Storage Service (S3) is an object storage service offering industry-leading scalability, data availability, security, and performance.
This module can be used to send logs to Amazon S3 and compatible services.
Amazon S3 buckets, objects, keys, and structure
Amazon S3 stores objects inside containers called buckets. See Getting Started with Amazon S3 in the Amazon S3 User Guide for more information.
Every om_amazons3 instance interacts with a single bucket on Amazon S3. The module will not create, delete, or alter the bucket or any of its properties, permissions, or management options. Instead, you must create the bucket, provide the appropriate permissions (ACL), and further configure any lifecycle, replication, encryption, or other options. Similarly, the module does not alter the storage class of the objects or any other properties or permissions.
By default, the module uses a schema where each object has a key that references the server or service name, the date, and the time of the event. Although Amazon S3 uses a flat structure to store objects, it groups objects with similar key prefixes resembling a filesystem structure. The following is a visual representation of our default naming scheme.
MYBUCKET/
└── SERVER01/
└── 2025-06-18/
├── 12.30.45.0
├── 12.30.45.1
└── 12.30.45.2
└── SERVER02/
└── 2025-06-17/
├── 14.23.12.0
├── 14.23.12.1
└── 14.23.12.2
You can change the schema by specifying the KeyTemplate directive.
Configuration
The om_amazons3 module accepts the following directives in addition to the common module directives. The Bucket, Region, and Server directives are required.
The AccessKey and SecretKey directives are required if NXLog Agent is not running in the same tenant as the S3 bucket.
Required directives
The following directives are required for the module to start.
This mandatory directive specifies the Amazon S3 bucket name. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This mandatory directive specifies the service region code. It accepts any value when used in conjunction with the URL directive. Otherwise, the following codes are supported:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This mandatory directive sets the object path prefix. The module will write object names starting with the specified value. See Amazon S3 buckets, objects, keys, and structure. |
HTTPS directives
The following directives configure secure data transfer via HTTPS.
Set this directive to |
|
Set this directive to |
|
Set this directive to the path of a directory containing Certificate Authority (CA) certificates.
The module uses these certificates to verify the certificate presented by the remote host.
Name the certificate files using the OpenSSL hashed format: the hash of the certificate followed by
For example, if the certificate hash is To trust a remote host’s self-signed certificate, include a copy of it in this directory. If this directive isn’t specified, NXLog Agent falls back to the default operating system root certificate store.
Unix-like operating systems commonly store root certificates in In addition, Microsoft’s PKI repository contains root certificates for Microsoft services. |
|
Set this directive to the path of the Certificate Authority (CA) certificate used to verify the certificate presented by the remote host. To trust a remote host’s self-signed certificate, specify the remote host’s certificate itself. For certificates signed by an intermediate CA, the specified certificate must contain the complete certificate chain (certificate bundle). |
|
Set this directive to the path of the certificate file to present to the remote host during the HTTPS handshake. |
|
Set this directive to the path of the private key file corresponding to the certificate specified by HTTPSCertFile. |
Optional directives
This optional directive specifies the AWS public access key ID. If AccessKey and SecretKey are missing, the module will try to read the credentials from the environment, STS, profile, or instance metadata. If none are available, the module will try to log in anonymously. |
|||||||||||||||||||||||||||||
Set this directive to a custom header to add to each HTTP request. Specify this directive multiple times to add more than one header. |
|||||||||||||||||||||||||||||
Set this directive to enable HTTP compression for outgoing HTTP messages.
The accepted values are Some HTTP servers may not accept compressed HTTP requests.
If the server doesn’t support the specified compression method, it may return |
|||||||||||||||||||||||||||||
Set this directive to the HTTP basic authentication password. This directive requires you to also set the HTTPBasicAuthUser directive to use HTTP authentication. |
|||||||||||||||||||||||||||||
Set this directive to the HTTP basic authentication username. If the HTTPBasicAuthPassword directive is not set, the module attempts HTTP Basic authentication using an empty password. |
|||||||||||||||||||||||||||||
Set this directive to the maximum request size, in bytes. The default is 64 MB. |
|||||||||||||||||||||||||||||
This optional directive sets the reconnect interval in seconds. If it is set, the module attempts to reconnect in every defined second. If it is not set, the reconnect interval will start at 1 second and double with every attempt. In the latter case, when the system decides that the reconnection is successful, the reconnect interval is immediately reset to 1 sec.
|
|||||||||||||||||||||||||||||
This optional directive defines the behavior when the connection with the remote host is lost.
When set to |
|||||||||||||||||||||||||||||
Use this directive to change the naming scheme of objects in the bucket. You can use the following placeholders:
The value must adhere to the following requirements:
Refer to the Amazon S3 General purpose bucket naming rules. The default value is See Amazon S3 buckets, objects, keys, and structure for more information.
|
|||||||||||||||||||||||||||||
Number of allowed parallel HTTP connections. More connections mean bigger throughput. The default is 1. |
|||||||||||||||||||||||||||||
See the OutputType directive in the list of common module directives.
If this directive is not specified, the default is LineBased, i.e., the module will use This directive also supports data converters, see the description in the OutputType section. |
|||||||||||||||||||||||||||||
This boolean directive changes how the module constructs the URL to cater to providers like MinIO, which accepts the bucket name in the path instead of a subdomain.
The default is |
|||||||||||||||||||||||||||||
This optional directive specifies the AWS secret access key. |
|||||||||||||||||||||||||||||
Specify the URL for a custom endpoint. If the protocol is not specified, the module will use HTTPS. |
|||||||||||||||||||||||||||||
This optional directive specifies the number of seconds to wait before sending logs to the service.
When set, it overrides the value of the |
Examples
This configuration uses the om_amazons3 output module to forward logs to an Amazon S3 Bucket named MYBUCKET.
Object names will be prefixed with SERVER01 specified by the Server directive.
<Output amazon_s3>
Module om_amazons3
Region us-east-1
Bucket MYBUCKET
Server SERVER01
AccessKey <YOUR_ACCESS_KEY> (1)
SecretKey <YOUR_SECRET_KEY> (2)
</Output>
This configuration uses the om_amazons3 output module to forward logs to a self-hosted MinIO S3 instance.
<Output amazon_s3>
Module om_amazons3
URL https://example.net (1)
Region myminio
Bucket MYBUCKET
Server SERVER01
AccessKey <YOUR_ACCESS_KEY> (2)
SecretKey <YOUR_SECRET_KEY> (3)
</Output>