From AWS CloudWatch Logs

Migrate from AWS CloudWatch Logs

Move new AWS logs to your Logit.io Logs stack. Collect logs at the source when you control the host or workload. For AWS services that already write to a CloudWatch log group, keep the group and forward its new events with Lambda.

What carries over

AWS CloudWatch LogsLogit.io
Files or Windows events collected by the CloudWatch agentCollect them with the OpenTelemetry Collector, Filebeat or Winlogbeat.
EKS pod logsUse OpenTelemetry on Kubernetes or keep Fluent Bit.
ECS application container logsSwitch the task's log driver to FireLens.
CloudWatch log groupsForward new events with a subscription filter and Lambda.
Metrics and tracesSend with OpenTelemetry. They are stored only if the stack has the Metrics or APM add-on. This guide moves logs.
Logs Insights queries and metric filters used for log alertsRebuild the searches and alerts you need in OpenSearch Dashboards and Logit.io alerts.

Option 1: replace CloudWatch agent log collection

  1. List the paths, Windows event channels and multiline settings in the CloudWatch agent's log configuration. Note which log group and stream names your queries use.
  2. Follow the server log files guide to install the OpenTelemetry Collector. Map files to filelog and Windows channels to windowseventlog receivers. For EKS pod logs, use the Kubernetes Helm guide.
  3. Configure the otlp_http exporter to send http/protobuf over HTTPS to https://{stackId}-otel.logit.io. Use Basic auth with {stackId}-otel and the stack's Hosted OpenTelemetry API key from the Endpoints page. See the Hosted OpenTelemetry quickstart.
  4. Test one host or workload. When logs match, remove the migrated log entries from the CloudWatch agent configuration. Keep the agent running if it still collects metrics or other logs you need.

For a host that already runs Beats, use Filebeat for log files or Winlogbeat for Windows event logs. Each integration fills in its own Beats SSL endpoint.

Option 2: send EKS logs with Fluent Bit

If Fluent Bit already runs as a DaemonSet on your EKS worker nodes, keep its pod log inputs, parsers and Kubernetes metadata filters. For a new Fluent Bit DaemonSet on EC2 worker nodes, configure a tail input to read the node's container log files and a Kubernetes filter to add pod metadata. Select your Logs stack to fill in the Fluent Bit integration connection details for TCP over TLS. If you prefer Filebeat on EKS, follow the AWS EKS Logs integration instead.

In the configuration used by the DaemonSet, replace the cloudwatch_logs output for the pods you are moving with this output. Use the old output's Match pattern if it only forwards a subset of tags.

fluent-bit.conf
[OUTPUT]
    Name tcp
    Match *
    Host @logstash.host
    Port @logstash.sslPort
    tls On
    Format json_lines
    json_date_format iso8601
    json_date_key @timestamp

Roll out the updated configuration to the DaemonSet. Generate a log from a test pod and check its namespace, pod and container fields in Discover. During a side-by-side test, check whether Lambda is also forwarding the same pods through a CloudWatch log group.

Option 3: send ECS logs with FireLens

For application containers that use the awslogs driver, create a new task definition revision with a FireLens log router running AWS for Fluent Bit. Set the router container's firelensConfiguration type to fluentbit. Use the same TCP TLS output as the Fluent Bit integration.

Replace logConfiguration on each application container you want to move. FireLens generates the output match for the container. Keep the log router's own logging configured so you can inspect its errors.

{
  "logConfiguration": {
    "logDriver": "awsfirelens",
    "options": {
      "Name": "tcp",
      "Host": "@logstash.host",
      "Port": "@logstash.sslPort",
      "tls": "On",
      "Format": "json_lines",
      "json_date_format": "iso8601",
      "json_date_key": "@timestamp"
    }
  }
}

Deploy one test task using the new revision. Allow the task's network to reach the stack's TCP SSL port. Generate a log on standard output or standard error and check the message and ECS metadata in Discover before updating the service.

Option 4: forward log groups with Lambda

Keep CloudWatch as the source for AWS-managed log groups or workloads that still need CloudWatch. Use the AWS Lambda CloudWatch integration to deploy the documented handler and set LOGIT_API_KEY to your stack API key.

  1. In the Lambda console, add a CloudWatch Logs trigger for a test log group. This sets up a CloudWatch Logs subscription filter with the function as its destination. Set a filter pattern if you only want matching events.
  2. Generate a new event in the log group. Check the function for delivery errors and look for the event in Discover. The handler sends message, logGroupName, logStreamName and timestamp.
  3. If you need the original event time in @timestamp, add the integration's optional CloudWatch timestamp filter. Repeat for the other groups you plan to forward.

Check the cutover

  1. In OpenSearch Dashboards, open Discover and check new events from each host, workload or log group you moved.
  2. Compare counts for the same source and time window. Check timestamps, multiline messages and any metadata your queries use.
  3. Watch for duplicates if you collect at the source and forward its CloudWatch log group too. A Lambda retry can also resend an event that was already queued.
  4. Rebuild the searches and alerts your team uses, then retire the old log destination settings or subscriptions you no longer need.

Not covered

  • Pointing the CloudWatch agent at a Logit.io endpoint. Use a replacement collector or forward the log group.
  • A direct AWS Firehose HTTP destination. Use the CloudWatch Lambda integration.
  • Backfilling existing log events or converting CloudWatch Logs Insights queries.

If you need help planning a migration, contact support via live chat.