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. A path segment containing * matches folder names at that level (* never crosses a /), so one source can read many sibling folders, e.g. o-abc/AWSLogs/o-abc/*/CloudTrail/us-east-1 reads every account. Matching folders are re-discovered every 5 minutes; each keeps its own progress and a new folder is read from the lookback start. Up to 1000 folders, and max_objects_per_scan applies per folder. Requires a collector build with wildcard support.
s3_partition_formatstringnone (empty)NoFormat for the partition key, e.g. %Y/%m/%d for AWS service delivery or year=%Y/month=%m/day=%d/hour=%H/minute=%M. Leave it empty (or set none) for objects that are not stored under date folders (e.g. CloudWatch export tasks): every object under the prefix, at any depth, is read once, oldest first by S3 last-modified time. Each poll lists the whole prefix, so prefer a longer poll_interval for large buckets. Requires a collector build with flat-mode support.
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, elbaccess, and waf use suffix .log (matches standard S3 keys such as ...log / ...log.gz after decompress); cloudtrail, 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). Set to false for JSON Lines (one object per line), such as GuardDuty exports.
file_suffixeslistnoneNoObject key endings the selected encoding is applied to, compared after .gz is removed (a typed .jsonl.gz is treated as .jsonl unless decompress is none). Empty uses the encoding defaults: .json and .jsonl for json_log_encoding, .txt for text_encoding, and the per-format suffix above for aws_logs_encoding. * applies the encoding to every object under the prefix. Objects that fail to decode are skipped and counted as parse errors. Ignored when encoding is none.
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). Ignored for any other payload format.
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.
late_arrival_windowstring15mNoHow long a partition folder stays open for re-scanning after its nominal time. S3 delivery (WAF, ALB, CloudTrail, Firehose) writes objects under a path derived from event time, often minutes later, so a folder that lists empty now can gain objects afterwards. Polling never advances past now - late_arrival_window, which is what keeps those objects reachable. Set to 0s to disable the hold.
max_tracked_keys_per_windowinteger10000NoUpper bound on the per-folder set of already-read object keys that makes late arrivals detectable. A folder exceeding this collapses to a single ordering cursor, after which a late object sorting below it is skipped. Raise it for very high-volume partitions; 0 means unbounded.

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,
// Keeps recent partition folders re-scannable so objects S3 delivers late are
// not missed. Raise it if your source's delivery lag exceeds 15 minutes.
"late_arrival_window": "15m", // default: "15m"
"max_tracked_keys_per_window": 10000, // default: 10000

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