Skip to main content

AWS S3

Overview

AWS S3 downloads and processes log files from an S3 bucket using the AWS SDK for S3.

Supported platforms

  • Linux: Logs
  • Windows: Logs
  • macOS: Logs

Authentication

AWS S3 supports AWS credentials.

ParameterTypeDescription
credential_typeoptionaws or awsimds.
access_key_idstringAWS access key (required if using aws).
secret_access_keystringAWS secret key (required if using aws).
session_tokenstringOptional session token for temporary credentials.

Note: The Credential Type field is required if not using default AWS credentials.

S3 Downloader

ParameterTypeDefault ValueRequiredDescription
regionstringnoneYesThe AWS region where your S3 bucket is located.
s3_bucketstringnoneYesThe name of the S3 bucket to download from.
s3_prefixstringnoneNoThe prefix path in the S3 bucket to search for objects.
s3_partition_formatstringyear=%Y/month=%m/day=%d/hour=%H/minute=%MNoFormat for the partition key.
s3_partition_timezonestringUTCNoThe timezone for partitioning (IANA timezone name applied when formatting the partition key).
file_prefixstringnoneNoOptional prefix to filter files in the S3 bucket.
file_prefix_include_telemetry_typebooleanfalseNoWhether to include telemetry type in the file prefix.

Data Selection

ParameterTypeDefault ValueRequiredDescription
valueinteger1YesNumber of units to look back. Max allowed is 4 weeks (1 month).
unitstringweekYesTime unit for the lookback window.

Polling

ParameterTypeDefault ValueRequiredDescription
poll_intervalstring10sNoTime between polls for new objects when using time-based polling.
encodingstringnoneNoOptional OpenTelemetry encoding extension wired into the S3 receiver: none, text_encoding, aws_logs_encoding, or json_log_encoding.
aws_logs_formatstringnoneWhen encoding is aws_logs_encodingformat value for the AWS logs encoding extension (for example s3access, cloudtrail, vpcflow). The rendered collector registers the extension as aws_logs_encoding/<format> with an encodings suffix chosen from this format: vpcflow and elbaccess use suffix .log (matches standard S3 keys such as ...log / ...log.gz after decompress); cloudtrail, waf, cloudwatch, networkfirewall, and s3access use suffix .json.
json_log_encoding_modestringbodyWhen encoding is json_log_encodingmode for the JSON log encoding extension: body or body_with_inline_attributes.
json_log_encoding_array_modebooleantrueNoMaps to the extension array_mode field (default true).
logs_payload_formatstringdefaultNoWhen set to json_array, maps to the awss3 receiver logs_payload_format field (for example AWS Config snapshots stored as a JSON object with a single array of records).
logs_json_array_fieldstringnoneWhen logs_payload_format is json_arrayMaps to logs_json_array_field in the generated collector config (for example configurationItems).
decompressstringautoNoWhether to decompress log files if they are compressed.
max_objects_per_scaninteger10NoMaximum number of objects to process in a single poll cycle.
max_bytes_per_objectinteger1048576NoMaximum number of bytes to read from a single object.
max_log_sizeinteger1048576NoMaximum size of a single log entry in bytes.

State Management

ParameterTypeDefault ValueRequiredDescription
persist_offsetsbooleantrueNoPersist S3 object reading offsets to resume from where left off.

Example Configuration

{
"s3downloader": {
"region": "us-west-2", // required
"s3_bucket": "my-logs-bucket", // required
"s3_prefix": "logs/", // default: none
"s3_partition_format": "year=%Y/month=%m/day=%d/hour=%H/minute=%M", // default
"s3_partition_timezone": "UTC", // default
},

"lookback": {
"value": 1, // required, default: 1
"unit": "week", // required, default: "week"
},

"poll_interval": "10s", // default: "10s"
"encoding": "none", // none | text_encoding | aws_logs_encoding | json_log_encoding
// When encoding is aws_logs_encoding:
// "aws_logs_format": "s3access",
// When encoding is json_log_encoding:
// "json_log_encoding_mode": "body",
// "json_log_encoding_array_mode": true,
// Optional JSON-array snapshot style (AWS Config configurationItems, etc.):
// "logs_payload_format": "json_array",
// "logs_json_array_field": "configurationItems",
"decompress": "auto", // default: "auto"
"max_objects_per_scan": 10,
"max_bytes_per_object": 1048576,
"max_log_size": 1048576,

"persist_offsets": true, // default: true
}