S3 ingestion
Map of concepts
Map of concepts
S3 ingestion: usage events from files in Amazon S3
S3 ingestion is the import of usage events from files in an Amazon S3 bucket of your organization.S3 ingestion is set for each usage-event collection on its own. It adds one more way to send usage events to that usage-event collection, alongside the other ways, such as its API endpoint and CSV files. See Concepts: How usage events work.
- The bucket connection names the one bucket that Zenskar reads for your organization.
- Each usage-event collection that uses S3 ingestion has its own folder in that bucket. Zenskar stores the rows of each file in the folder as usage events of that usage-event collection.
api_calls/2026-10-01.csv. The folder api_calls belongs to the usage-event collection api_calls, so each row of the file becomes one usage event of api_calls.
This conceptual diagram shows S3 ingestion as one of the ways that usage events reach a usage-event collection.
Bucket connections: one bucket for the organization
A bucket connection is the setting that tells Zenskar which S3 bucket of your organization stores the files of usage events.Your organization can have one bucket connection. Its bucket must be in the AWS region
us-east-1.- The processor role is the AWS IAM role that Zenskar uses to read the files in the S3 bucket that a bucket connection names.
- The Zenskar SQS queue is the Amazon SQS queue of Zenskar that receives a notification when a new file arrives in the S3 bucket that a bucket connection names.
This conceptual diagram shows how Zenskar learns about a new file and reads it.
Each usage-event collection keeps the bucket that was connected when its S3 ingestion was last set up. When the bucket connection changes to another bucket, Zenskar reads the new bucket for a usage-event collection only after its S3 ingestion is set up again.
Disconnecting the bucket connection turns off S3 ingestion on every usage-event collection, and clears the folder and the error folder of each one. Connecting a bucket again does not restore them. Note the folders of your usage-event collections before you disconnect.
Ingestion-error buckets: where rejected files go
An ingestion-error bucket is an S3 bucket of your organization in which Zenskar writes an error file for each file that S3 ingestion rejects. Zenskar rejects a file as a whole. One row that fails is enough, and the file then adds no usage events. See Files that S3 ingestion reads. An ingestion-error bucket is optional. Without one, Zenskar writes no error file. Your organization sets the ingestion-error bucket together with its bucket connection. It can be the same bucket or another bucket, and it must be in the AWS regionus-east-1. Its bucket policy grants the processor role write access, so that Zenskar can write error files to it.
An error file is a CSV file that Zenskar writes to an ingestion-error bucket about a file that S3 ingestion rejects.
Zenskar writes one of two error files. In the name of an error file, <name> is the name of the rejected file without .csv, and <ID> identifies the processing of the file.
Zenskar writes the error files of a usage-event collection to its error folder. Without an error folder, Zenskar writes them to the folder
errors.
For example, one row of api_calls/2026-10-01.csv has text in a number field, so Zenskar rejects the file. With no error folder, the error file is errors/2026-10-01_<ID>_errors.csv.
A file that Zenskar does not read gets no error file, such as a file whose name does not end in .csv, or a file in a folder that belongs to no usage-event collection.
See Prepare an ingestion-error bucket.
Folders of usage-event collections
S3 ingestion is on or off for each usage-event collection. A usage-event collection with S3 ingestion on has its own folder in your S3 bucket. Zenskar reads each new file in that folder. By default, the folder has the name of the API slug of the usage-event collection. Two usage-event collections cannot have the same folder. A folder is a path in the bucket, such asapi_calls or usage/api_calls. The path has no trailing slash, and no part of it is . or ...
Zenskar reads a file only when its folder matches the folder of a usage-event collection exactly. The folder of a file is the whole path before its name:
An error folder is a folder of the ingestion-error bucket in which Zenskar writes the error files of one usage-event collection.
The error folder is optional. A usage-event collection can have one only when your organization has an ingestion-error bucket. When the ingestion-error bucket is your S3 bucket itself, the error folder cannot be the folder of any usage-event collection.
Turning off S3 ingestion for a usage-event collection stops Zenskar from reading its folder right away, and clears its folder and its error folder. Turning S3 ingestion on again does not restore them. Note both folders before you turn S3 ingestion off.
Files that S3 ingestion reads
S3 ingestion reads CSV files. Zenskar reads a file only when its name ends in.csv, in uppercase or lowercase letters, such as .CSV. Zenskar ignores every other file.
The first row of a file is a header row that names the fields of the data schema of the usage-event collection:
- The header names every field, including the root fields
customer_idandtimestamp. - The header names no column that the data schema does not have.
- The columns can be in any order.
- The
data.prefix of a data field is optional. For example, the headerregionnames the data fielddata.region.
This conceptual diagram shows how S3 ingestion processes one file.