Log types
Each source carries one log type.
Supported formats are JSON, JSON arrays, newline-delimited JSON, and gzip-compressed versions of each. Objects in other formats (Parquet, ZIP, and so on) are reported with an actionable error on the source instead of being ingested.
Step 1: Create the queue and role
On the integration page, select Add log source and enter each bucket and prefix, and any customer-managed KMS keys that encrypt the objects. The setup section fills them, the Cotool principal, and your External ID into a Terraform configuration, an AWS CLI script, and a CloudFormation template. Each creates:- a dedicated SQS queue (
cotool-log-ingest-<suffix>) with a dead-letter queue, and a queue policy that accepts notifications from your log buckets, - an IAM role (
CotoolLogIngest-<suffix>) that trusts the Cotool principal only with your external ID, and can:sqs:ReceiveMessage,sqs:DeleteMessage,sqs:ChangeMessageVisibility, andsqs:GetQueueAttributeson that queue,s3:GetObjectands3:GetObjectVersionon each bucket prefix,kms:Decrypton the log keys, when objects are encrypted with customer-managed KMS keys.
<suffix> is a short random value generated for each setup, so several sources can live in the same account. Cotool only assumes roles whose name starts with CotoolLogIngest; keep that prefix if you rename the role.
Step 2: Deploy it
Deploy in the buckets’ account and region: S3 only notifies queues in its own region. S3 keeps a single notification configuration per bucket, so the generated notification script addss3:ObjectCreated:* notifications for each prefix only to buckets that have none, and prints what to add to the others.
- Terraform
- AWS CLI
- CloudFormation
- Save the configuration in your infrastructure repository, and configure the AWS provider for the buckets’ account and region.
- Run
terraform init, reviewterraform plan, then runterraform apply. - Run the generated
cotool-bucket-notifications.sh, which reads the queue fromterraform output. The configuration only manages the notifications itself when you setmanage_bucket_notifications = true, becauseaws_s3_bucket_notificationreplaces a bucket’s entire notification configuration. If Terraform already manages a bucket’s notifications, add the queue to that resource instead. terraform outputprintsqueue_urlandrole_arnfor the connection form.
Step 3: Connect the source
- Connect: enter the queue URL (the region fills in from it), the role ARN, and each bucket and prefix Cotool may read. Objects outside these prefixes are skipped even if they reach the queue.
- Test: Cotool assumes the role, reads the queue attributes, samples up to ten messages, and reads one announced object. Sampled messages are returned to the queue, not deleted. If the queue is empty, paste a sample log.
- Format: name the source and choose AWS CloudTrail, Generic JSON, or Custom format, normalized to OCSF. Cotool previews the sampled events parsed with that format.
- Select Enable source, or Save paused to enable it later. Enabling needs a passing test.
Reliability
- Messages are deleted only after the object’s events are archived and indexed. If Cotool restarts mid-run, the message becomes visible again and is reprocessed.
- A temporary failure (throttling, a network error, or access denied while permissions are being fixed) keeps the message on the queue and retries it with backoff up to 15 minutes, for about a day with the template’s dead-letter settings.
- Malformed lines are skipped individually and kept in the raw archive with the reason. Objects that can never be read (unsupported format, deleted, too large) are recorded on the source and their messages removed so they cannot block the queue.
- Redelivered notifications do not create duplicates: CloudTrail events are keyed by
eventID, and generic records by object version and position.