The out_s3
Output plugin writes records into the Amazon S3 cloud object storage service. By default, it creates files on an hourly basis. This means that when you first import records using the plugin, no file is created immediately.
The file will be created when the timekey
condition has been met. To change the output frequency, please modify the timekey
value in the buffer section. For more details, see time chunk keys.
This document doesn't describe all parameters. If you want to know full features, check the Further Reading section.
out_s3
is included in td-agent by default. Fluentd gem users will need to install the fluent-plugin-s3 gem. In order to install it, please refer to the Plugin Management article.
<match pattern>
@type s3
aws_key_id YOUR_AWS_KEY_ID
aws_sec_key YOUR_AWS_SECRET_KEY
s3_bucket YOUR_S3_BUCKET_NAME
s3_region ap-northeast-1
path logs/
# if you want to use ${tag} or %Y/%m/%d/ like syntax in path / s3_object_key_format,
# need to specify tag for ${tag} and time for %Y/%m/%d in <buffer> argument.
<buffer tag,time>
@type file
path /var/log/fluent/s3
timekey 3600 # 1 hour partition
timekey_wait 10m
timekey_use_utc true # use utc
chunk_limit_size 256m
</buffer>
</match>
Please see the Store Apache Logs into Amazon S3 article for real-world use cases.
Please see the Config File article for the basic structure and syntax of the configuration file.
For <buffer>
section, see Buffer Section Configuration. By default, this plugin uses the file
buffer.
The value must be s3
.
type | default | version |
---|---|---|
string | required/optional | 1.0.0 |
The AWS access key id. This parameter is required when your agent is not running on an EC2 instance with an IAM Instance Profile.
type | default | version |
---|---|---|
string | required/optional | 1.0.0 |
The AWS secret key. This parameter is required when your agent is not running on an EC2 instance with an IAM Instance Profile.
S3 plugin supports several credentials.
See README.
type | default | version |
---|---|---|
string | required | 1.0.0 |
The Amazon S3 bucket name.
The buffer of the S3 plugin. The default is the time-sliced buffer.
For more details, see buffer
.
type | default | version |
---|---|---|
string | ENV["AWS_REGION"] or us-east-1 |
1.0.0 |
The Amazon S3 region name. Please select the appropriate region name and confirm that your bucket has been created in the correct region.
Here are some regions:
us-east-1
us-west-1
eu-central-1
ap-southeast-1
sa-east-1
See the complete list of regions here.
The format of the object content. The default is out_file
.
JSON example:
<format>
@type json
</format>
See formatter
article for more detail.
type | default | version |
---|---|---|
string | "" | 1.0.0 |
The path prefix of the files on S3. The default is "" (no prefix).
The actual path on S3 will be: {path}{time_slice_format}_{sequential_index}.gz
(see s3_object_key_format
) by default.
type | default | version |
---|---|---|
string | %{path}%{time_slice}_%{index}.%{file_extension} |
1.0.0 |
The actual S3 path. This is interpolated to the actual path (e.g. Ruby's variable interpolation):
path
: the value of thepath
parameter abovetime_slice
: the time string as formatted by buffer configurationindex
: the index for the given path. Incremented per buffer flushfile_extension
: as determined by thestore_as
parameter.
For example, if:
s3_object_key_format
: defaultpath
:hello
time_slice
:%Y%m%d
store_as
:json
Then, hello20141111_0.json
would be the example of an actual S3 path.
This parameter is for advanced users. Most users should NOT modify it. Also, always make sure that %{index}
appears in the customized s3_object_key_format
(Otherwise, multiple buffer flushes within the same time slice throws an error).
type | default | version |
---|---|---|
string | "gzip" | 1.0.0 |
The compression type.
Supported types: lzo
, json
, txt
type | default | version |
---|---|---|
string | nil | 1.0.0 |
The proxy URL.
type | default | version |
---|---|---|
bool | true | 1.0.0 |
Verify the SSL certificate of the endpoint. If false
, the endpoint SSL certificate is ignored.
It allows the user to set different levels of logging for each plugin.
Supported levels: fatal
, error
, warn
, info
, debug
, trace
Please see the logging article for further details.
This page does not describe all the possible configurations. For more details, follow this:
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is an open-source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.