Send logs to Amazon S3
Create a stream that writes the logs of your applications as objects in an Amazon S3 bucket, in Azion Console or with the Azion API, and confirm the delivery.
You can send the logs of a stream to an Amazon S3 bucket from Azion Console or with the Azion API. To send them to an Azion Object Storage bucket, whose credential needs other capabilities, refer to Send Data Stream data to Object Storage.
Data Stream writes each batch of log lines as one object in the bucket. In the stream form, the endpoint is set in the field labeled Connector, and Amazon S3 is its Simple Storage Service (S3) option. For every field and its bounds, refer to Endpoints.
The example collects the requests of one workload with the Applications data source.
Prerequisites
Console
- An Azion account with the Edit Data Stream permission. For the permissions, refer to Stream settings.
- A workload on the account that receives requests.
- An Amazon S3 bucket. The bucket must exist before the stream sends to it. It can use server-side encryption with Amazon S3 managed keys (SSE-S3).
- The region code of the bucket, such as
us-east-1. - An AWS Identity and Access Management (IAM) credential with an access key ID and a secret access key. The credential needs the
s3:ListBucketpermission, to list the objects of the bucket, and thes3:PutObjectpermission, to write objects in it. - Access to Azion Console. To sign in, refer to How to access Azion Console.
Create the stream
The stream collects from the workload you choose, through a workload filter. Unlike sampling, a workload filter leaves your other streams active.
Console
To create the stream in Azion Console:
Access Azion Console > Data Stream.
In the General section, enter a Name. For example: logs-to-s3.
In the Input section, select Applications in Data Source.
In the Transform section, turn off Sampling while Option is still All Current and Future Workloads, its starting value. A stream cannot carry sampling and a workload filter together.
In the Transform section, set Option to Filter Workloads. In Available Workload, select your workload and move it to Chosen Workload with the arrow. If your Console names domains where this guide names workloads, the same control reads Filter Domains. The pick list then reads Available Domain and Chosen Domain.
In the Render Template section, select Applications Event Collector in Template.
In the Output section, select Simple Storage Service (S3) in Connector.
Enter the S3 host of the bucket’s region in URL, such as https://s3.us-east-1.amazonaws.com. Enter the bucket name in Bucket Name and its region code in Region.
Enter the access key ID in Access Key and the secret access key in Secret Key. The Console masks both fields.
In Object Key Prefix, enter the start of each object name. For example: azion/logs.
In Content Type, select plain/text or application/gzip. With plain/text, each object holds one log line per line.
In the Status section, keep Active turned on.
The Console shows Your data stream has been created. The stream appears in the Data Stream list with Amazon S3 in the Connector column and the Active status.
The API and the Console save the stream without contacting the bucket. A wrong URL, region, or credential surfaces only when the stream sends. An activation takes effect after one to two minutes.
Confirm the delivery
Real-Time Events records every send of a stream, delivered or not, with the status code the endpoint returned. Send a few requests to the workload, then wait about a minute: a stream sends a batch every 60 seconds, or sooner when it reaches 2,000 log lines.
Console
To find the sends in Azion Console:
Access Azion Console > Real-Time Events.
Each row is one send. Find the rows with S3 in Endpoint Type, and read their Status Code.
A Status Code of 200 means the bucket accepted the batch. Streamed Lines gives the number of log lines in the batch.
A status other than 200 is the answer of the endpoint, and 503 means Data Stream found the endpoint unavailable. For the causes, refer to Troubleshoot Data Stream.
In the bucket, each object name is the Object Key Prefix, a /, the date and time of the send in the YYYY/MM/DD/hh/mm/ format, and a UUID. With the prefix azion/logs, an object name starts with a path such as azion/logs/2026/01/01/12/02/, followed by the UUID.