Published

CloudWatch Logs Offload: Vector, S3 and Loki with Reviewable Audit Trails

Separate Flow Log Parquet delivery from container-log collection, preserve evidence lineage, and include delivery, storage, query and recovery costs.

Working through this in your own environment? See the scope of a telemetry audit.

Moving a copy of a CloudWatch log stream to S3 does not undo the ingestion that already happened. To change that meter, identify a supported route that collects the required source before CloudWatch ingestion, then prove that the replacement preserves the agreed audit and incident capabilities.

Some streams must remain in CloudWatch because of their consumers or service support. A selective offload is often a better pilot than an all-or-nothing logging migration. Start with source ownership, retention, search/detection requirements and an actual matching-period bill.

Use separate routes for different source types

VPC Flow Logs -> supported direct S3 delivery -> Parquet -> Athena / reviewed analysis
Container logs -> node-local Vector -> protected raw S3 archive
                                  \-> optional operational Loki / OpenSearch pipeline
Critical retained CloudWatch streams -> existing alarms / incident consumers

VPC Flow Logs S3 delivery is a service delivery path. It is not the same as converting every application log into Parquet with Vector. Preserve the original source format and describe any transformation explicitly.

SourceCandidate routeCapability to verify
Supported VPC Flow LogsDirect S3 delivery, with supported format/partition optionsExpected traffic records, delivery health and query coverage
Kubernetes container stdout/stderrApproved node-local collector and sinkFile rotation, checkpoints, buffering and missing-node behavior
CloudWatch-only service logsRetained or supported subscription/export pathExisting ingestion remains a cost; downstream consumers still work
Operational search subsetLoki or OpenSearch pipelineIndexing/query semantics, retention and alert compatibility

Configure durable buffering without promising zero loss

The following is a Vector configuration fragment for reviewed Kubernetes collection and an S3 JSON archive. Confirm its options against the Kubernetes logs source and S3 sink for the pinned Vector release.

data_dir = "/var/lib/vector"

[sources.kubernetes_logs]
type = "kubernetes_logs"

[sinks.audit_archive]
type = "aws_s3"
inputs = ["kubernetes_logs"]
bucket = "${AUDIT_BUCKET}"
region = "${AWS_REGION}"
key_prefix = "container-logs/%F/"
compression = "gzip"
encoding.codec = "json"
acknowledgements.enabled = true
buffer.type = "disk"
buffer.max_size = 536870912
buffer.when_full = "block"

This is not a complete deployment or an Object Lock policy. Supply the approved Kubernetes RBAC, workload identity, TLS/network path and persistent storage. Do not embed long-lived AWS keys in a ConfigMap. If buffer storage disappears with a node, unsent records can disappear with it. Backpressure can also interact with container log rotation; a disk buffer does not create an unlimited source retention guarantee.

Pin the distribution and test configuration startup, then exercise actual record delivery in a controlled environment. Source/sink acknowledgement support and checkpoint behavior must be reviewed together. An acknowledged write is not by itself proof that a retention lock or downstream query requirement was satisfied.

Keep archive integrity and queryability distinct

Enable the approved S3 versioning, encryption, key policy, retention and deletion controls. S3 Object Lock applies retention/legal-hold controls to object versions under its configured mode. A bucket name containing “audit” is not an immutability control.

Retain source, account/Region/cluster scope, timestamps, object identity/version, transformation revision and input/output counts or appropriate completeness checks. Protect read, decrypt and administration separately. Preserve retention decisions, access logging and restore/query tests.

Loki uses its own ingestion, indexing and storage model. Placing raw JSON or Parquet in S3 does not automatically make it searchable as native Loki history. OpenSearch likewise needs a reviewed ingestion/index lifecycle and introduces its own operating costs. Keep the raw evidence archive distinct from the curated operational search representation.

Model all the meters

CloudWatch cost guidance distinguishes ingestion, storage, queries and vended-log delivery. Direct S3 delivery can still incur vended-log charges, format-conversion charges where applicable, S3 requests/storage, encryption-key operations and query scan costs. Do not treat the familiar $0.50/GB headline as a universal rate across Regions, log classes and source types.

candidate monthly cost = remaining CloudWatch
                       + source delivery / conversion
                       + S3 / keys / requests / query scans
                       + collector and search infrastructure
                       + operating effort

Add migration and recovery testing separately. A CloudWatch subscription/export that follows initial ingestion may help retention or downstream access without removing the original ingestion charge. The NAT and PrivateLink cost guide covers the transport component.

Prove the audit trail survives failure

Controlled caseRequired evidence
Known source recordsSearchable/retained records with correct scope and timestamps
Sink unavailable or throttledBuffer/backpressure/loss behavior visible
Collector restart and file rotationReviewed checkpoint/recovery behavior
Node removed with unshipped dataResidual-loss boundary measured and addressed
Retention/deletion attemptApproved object-version controls behave as intended
Incident query or alert replayRequired operational capability still works

Keep the old route available until the selected source, audit retention and incident checks pass. Expand by measured population rather than announcing that every log is offloaded after one sink returns success.

The 14-Day Datadog & Telemetry Cost Audit — $3,500 scopes one billing period and one reversible pilot. Use the calculator for a local estimate; a broader routing/storage implementation is separately quoted.

Continue in the datadog-cost-cut topic hub.

Frequently asked questions

Does exporting CloudWatch logs to S3 remove the original ingestion cost?

No. A downstream export or subscription follows ingestion. To reduce that meter, evaluate a supported source route before ingestion and preserve the required capabilities.

Can Loki query an arbitrary raw S3 archive as native history?

Not automatically. Loki has its own ingestion/index/storage representation. Keep raw evidence storage and operational search pipelines distinct.

Does a Vector disk buffer guarantee zero log loss?

No. Review source checkpoints, acknowledgement support, storage survival, backpressure and file rotation. Test sink failure, collector restart and node loss.

Browse all writing · RSS feed

Tymur Chmeruk

Written by

Tymur Chmeruk

Cloud Security & Infrastructure Engineer · Baltimore–Washington Metro · [email protected]