CubeAPM
CubeAPM CubeAPM

CloudWatch Logs vs OpenSearch: Complete Comparison 2026

CloudWatch Logs vs OpenSearch: Complete Comparison 2026

Table of Contents

CloudWatch Logs and OpenSearch solve different problems and exist at different points in the AWS observability stack. CloudWatch Logs is AWS’s managed log aggregation service, tightly integrated with AWS services and billed on ingestion volume. OpenSearch is a search and analytics engine that requires you to run and manage a cluster, but gives you flexible querying, custom dashboards, and long term retention without CloudWatch’s storage tier pricing.

The comparison matters because most AWS teams hit a decision point where CloudWatch’s search limitations or retention costs push them toward OpenSearch, or where OpenSearch’s operational overhead makes them reconsider whether CloudWatch Logs plus a simpler tool would work better. According to the CNCF Annual Survey 2023, 64% of organizations use managed logging services, but 47% also run self-hosted observability tools for cost control and data sovereignty.

This guide compares CloudWatch Logs and OpenSearch across cost structure, search experience, deployment model, and signal depth. It includes real cost scenarios for teams ingesting 5TB to 30TB monthly, a migration decision framework, and alternatives that combine managed convenience with full search power.

Quick Comparison: CloudWatch Logs vs OpenSearch

CloudWatch LogsOpenSearch
DeploymentFully managed AWS serviceSelf-managed cluster (EC2, Kubernetes, or AWS OpenSearch Service)
Best forSimple log collection, AWS service logs, ephemeral debuggingDeep log analysis, custom dashboards, long retention, security analytics
Pricing model$0.50/GB ingested + $0.03/GB stored/monthCluster cost (compute + storage) + data transfer
Query languageCloudWatch Logs Insights (SQL-like)OpenSearch Query DSL, SQL plugin
Retention1 day to 10 years, tiered storage availableUnlimited, defined by disk capacity
Search speedFast on recent logs, slower on archived dataFast across all indexed data
VisualizationCloudWatch dashboards, basic chartsOpenSearch Dashboards (fork of Kibana), advanced visualizations
Alert complexityMetric alarms, anomaly detectionComplex alerting via plugins or external tools
Data residencyStays in AWS region selectedStays in cluster location (VPC, on-prem)
Maintenance burdenZeroHigh (cluster sizing, upgrades, shard management)

CloudWatch Logs Overview

CloudWatch Logs is AWS’s native log aggregation service. Every AWS service can send logs to CloudWatch automatically: Lambda writes function logs, ECS writes container logs, API Gateway writes request logs, RDS writes slow query logs. CloudWatch Logs collects them in log groups and streams, stores them, and lets you query recent logs with CloudWatch Logs Insights.

Pricing: $0.50/GB ingested, $0.03/GB/month stored in standard storage, $0.01/GB/month in infrequent access tier after 30 days. Query costs are $0.005 per GB scanned. Data transfer out to non-AWS destinations costs $0.09/GB after the first 1GB.

Strengths: Zero setup for AWS services. Automatic log collection from Lambda, ECS, API Gateway, CloudTrail, VPC Flow Logs, and others. Logs Insights query language is simple and works well for time-bounded searches. Integration with CloudWatch alarms and metric filters is native.

Limitations: CloudWatch Logs Insights queries become slow and expensive when scanning weeks or months of logs. The query language lacks the flexibility of OpenSearch’s Query DSL. Dashboards are basic compared to OpenSearch Dashboards. Long term retention at $0.03/GB/month adds up fast at scale. No built-in correlation with traces or distributed systems visibility.

Who should use CloudWatch Logs: Teams that need simple log aggregation for AWS services, short retention periods (days to weeks), and basic anomaly detection. Works well for startups and small teams where log volume stays under 1TB/month and search needs are minimal.

OpenSearch Overview

OpenSearch is an open source search and analytics engine forked from Elasticsearch 7.10. It runs as a cluster of nodes that index log data, execute queries, and serve dashboards. You can run OpenSearch on EC2 instances, in Kubernetes, or use AWS OpenSearch Service (managed but still requires cluster sizing and maintenance).

Pricing: AWS OpenSearch Service starts at $0.091/hour for a t3.small instance (~$65/month) plus EBS storage at $0.10/GB/month. A production cluster with three m6g.large.search instances (6 vCPU, 8GB RAM each) costs ~$460/month before storage. Self-hosted clusters on EC2 or Kubernetes require compute, storage, and data transfer costs, plus engineering time for cluster management.

Strengths: Powerful full-text search across all indexed fields. OpenSearch Dashboards gives you custom visualizations, histograms, and log pattern detection. Retention is unlimited, defined only by disk space. Query DSL supports complex aggregations, filtering, and regex. Works well for security analytics (SIEM), compliance logging, and long term log retention. Native AWS Lambda monitoring support via OpenSearch ingestion pipelines.

Limitations: High operational overhead. Cluster sizing, shard management, index lifecycle policies, and version upgrades are all manual. A misconfigured cluster can hit field mapping limits (default 1,000 fields per index), causing log ingestion failures. Query performance degrades if shards are poorly distributed or if heap memory runs low. Costs scale linearly with log volume because you pay for compute and storage together.

Who should use OpenSearch: Engineering teams with 5TB+ monthly log volume, long retention requirements (months to years), or deep search needs for security, compliance, or incident investigation. Works best when you have dedicated DevOps resources to manage cluster health.

Feature by Feature Comparison

Search and Query Experience

CloudWatch Logs Insights: SQL-like query syntax. Fast for recent logs (past 24 hours). Slower and more expensive when scanning weeks or months of data because each query scans raw log streams. No saved searches or query history beyond 30 days. Regex and field extraction work but are limited compared to OpenSearch.

OpenSearch: Full-text search with Query DSL. Indexed fields are instantly searchable without scanning raw logs. Supports complex queries (nested fields, aggregations, wildcard, regex, geo queries). Saved searches and dashboards persist indefinitely. Query speed depends on cluster size and shard distribution, but typically sub-second for well-indexed data.

Example: Searching 10TB of logs for a specific error message across the past 90 days costs $50 in CloudWatch Logs Insights query charges ($0.005/GB × 10,000GB). The same query in OpenSearch costs zero query fees but requires a cluster sized to store and index 10TB.

Retention and Storage Costs

CloudWatch Logs: Standard storage at $0.03/GB/month. Infrequent Access tier at $0.01/GB/month after 30 days. A team ingesting 10TB/month and keeping logs for 6 months pays $1,800/month in storage alone (10TB × 6 months × $0.03/GB). Tiering to Infrequent Access after 30 days saves ~$1,200/month but queries become slower.

OpenSearch: Storage cost is part of cluster cost. An m6g.large.search instance with 500GB EBS storage costs ~$50/month in storage ($0.10/GB/month × 500GB). A 10TB retention requirement needs 10TB of EBS storage = $1,000/month storage + compute. But you control retention policy directly. Deleting old indices is instant and free.

Cost comparison for 6-month retention, 10TB/month ingestion:

CloudWatch LogsOpenSearch (AWS managed)
Ingestion$5,000/month ($0.50/GB × 10TB)$0 (no ingestion fee)
Storage (6 months)$1,800/month (60TB × $0.03/GB)$6,000/month (60TB × $0.10/GB EBS)
Compute$0~$1,500/month (3× m6g.xlarge nodes)
Total$6,800/month$7,500/month

CloudWatch wins on cost for short retention. OpenSearch wins for long retention or high query volume because compute is fixed.

Integration with AWS Services

CloudWatch Logs: Native integration with every AWS service. Lambda, ECS, RDS, API Gateway, CloudTrail, VPC Flow Logs all write to CloudWatch automatically. No configuration needed beyond enabling logging.

OpenSearch: Requires a subscription filter in CloudWatch Logs to stream logs to OpenSearch. AWS provides a Lambda blueprint that transforms CloudWatch log events and indexes them into OpenSearch. Alternatively, you can use Firehose to send logs to OpenSearch, but that adds $0.029/GB delivery cost.

Reality check from GitHub issue: A user reported that CloudWatch Logs returned 80 CloudTrail events while OpenSearch returned only 10 for the same query and time range. The root cause was OpenSearch hitting the default 1,000-field mapping limit, silently dropping logs that exceeded the schema. Solution: increase index.mapping.total_fields.limit to 2,000 or higher.

Alerting and Anomaly Detection

CloudWatch Logs: Metric filters extract numeric values from logs and create CloudWatch metrics. Alarms trigger on metric thresholds. Anomaly detection uses machine learning to detect unusual patterns. Works well for simple alerts (error count spikes, latency thresholds). Limited for complex multi-condition alerts.

OpenSearch: Alerting plugin supports complex multi-condition alerts (e.g., “alert if error rate exceeds 5% AND P99 latency exceeds 500ms for 3 consecutive minutes”). Monitors run on a schedule and query OpenSearch indices. Notifications via Slack, PagerDuty, email, webhooks. More flexible than CloudWatch but requires manual configuration.

Data Residency and Compliance

CloudWatch Logs: Logs stay in the AWS region you select. Compliant with SOC 2, ISO 27001, HIPAA (with BAA), PCI DSS. Logs never leave AWS unless you explicitly stream them to an external destination. Data transfer to non-AWS destinations costs $0.09/GB.

OpenSearch: Self-hosted OpenSearch gives you full data residency. Logs stay in your VPC or data center. AWS OpenSearch Service keeps data in the region selected, with the same compliance certifications as CloudWatch. No data transfer cost if logs never leave your VPC.

Cost Scenarios: CloudWatch Logs vs OpenSearch at Scale

All pricing based on AWS US East (N. Virginia) public rate cards, April 2026. Scenarios model steady-state costs, not burst ingestion or variable retention.

Scenario 1: Small Team (5TB/month, 30-day retention)

CloudWatch Logs:

  • Ingestion: $2,500/month ($0.50/GB × 5TB)
  • Storage: $150/month (5TB × $0.03/GB)
  • Query costs: ~$50/month (light usage)
  • Total: $2,700/month

Cloudwatch costs can be estimated using our Cloudwatch pricing calculator.

OpenSearch (AWS managed, 2× m6g.large.search):

  • Compute: $300/month (2× $150/month)
  • Storage: $500/month (5TB × $0.10/GB EBS)
  • Data transfer: $0 (VPC-only)
  • Total: $800/month

OpenSearch wins by $1,900/month due to zero ingestion fees and lower storage cost for short retention.

Scenario 2: Mid-Market Team (30TB/month, 90-day retention)

CloudWatch Logs:

  • Ingestion: $15,000/month ($0.50/GB × 30TB)
  • Storage: $2,700/month (90TB × $0.03/GB)
  • Query costs: ~$300/month
  • Total: $18,000/month

OpenSearch (AWS managed, 3× m6g.2xlarge.search):

  • Compute: $1,800/month (3× $600/month)
  • Storage: $9,000/month (90TB × $0.10/GB EBS)
  • Data transfer: $0
  • Total: $10,800/month

OpenSearch wins by $7,200/month because ingestion cost dominates CloudWatch’s bill at this scale.

Scenario 3: Enterprise Team (100TB/month, 1-year retention)

CloudWatch Logs:

  • Ingestion: $50,000/month ($0.50/GB × 100TB)
  • Storage: $36,000/month (1,200TB × $0.03/GB)
  • Query costs: ~$1,000/month
  • Total: $87,000/month

OpenSearch (self-hosted on EC2, 10× m6g.4xlarge + 1.2PB EBS):

  • Compute: ~$4,000/month (10× $400/month)
  • Storage: $120,000/month (1,200TB × $0.10/GB EBS)
  • Data transfer: $0
  • Total: $124,000/month

CloudWatch wins at very long retention because OpenSearch storage cost ($0.10/GB EBS) is 3× CloudWatch’s standard storage ($0.03/GB). But OpenSearch gives unlimited search and dashboards, which CloudWatch does not.

This estimate models full retention on EBS. A real deployment would archive old logs to S3 ($0.023/GB standard, $0.004/GB Glacier) to cut storage cost by 60-80%.

Hidden Cost: Data Transfer to OpenSearch

Streaming CloudWatch Logs to OpenSearch via subscription filter triggers Lambda invocations and data transfer. Lambda costs are negligible (~$0.20 per million invocations), but VPC data transfer between CloudWatch and OpenSearch costs $0.01/GB if they are in the same region and availability zone. Cross-region transfer costs $0.02/GB. If you send 30TB/month from CloudWatch to OpenSearch in the same region, that adds $300/month in data transfer fees.

Who Should Choose CloudWatch Logs

Best for:

  • Teams with less than 2TB/month log volume
  • Short retention needs (days to weeks)
  • Logs primarily from AWS services (Lambda, ECS, API Gateway, RDS)
  • Teams that want zero operational overhead
  • Basic anomaly detection and metric extraction is sufficient

Real use case: A SaaS startup with 10 Lambda functions, 20 ECS tasks, and 1TB/month log volume. All logs go to CloudWatch automatically. Logs Insights handles simple queries (“find all 500 errors in the past hour”). CloudWatch alarms trigger on error rate spikes. No cluster to manage. Cost: ~$600/month.

Who Should Choose OpenSearch

Best for:

  • Teams with 5TB+ monthly log volume
  • Long retention requirements (months to years)
  • Deep search needs (security analytics, compliance, incident investigation)
  • Custom dashboards and visualizations required
  • Teams with DevOps resources to manage cluster health
  • AWS RDS monitoring that includes slow query log analysis

Real use case: A fintech platform ingesting 30TB/month from microservices, databases, and security logs. Retention requirement is 1 year for compliance. OpenSearch cluster with custom dashboards for security event correlation, slow query detection, and user behavior analytics. Cluster managed by dedicated SRE team. Cost: ~$12,000/month (compute + storage).

Streaming CloudWatch Logs to OpenSearch: How It Works

Most AWS teams use both CloudWatch Logs and OpenSearch together. CloudWatch collects logs, OpenSearch analyzes them. AWS provides a built-in workflow:

  1. Create a subscription filter on the CloudWatch log group
  2. Stream logs to a Lambda function using the AWS-provided blueprint
  3. Lambda transforms and indexes logs into OpenSearch

AWS documentation: Streaming CloudWatch Logs data to Amazon OpenSearch Service

Configuration steps:

  • Open CloudWatch Logs console → select log group → Actions → Create subscription filter
  • Select destination: Amazon OpenSearch Service
  • Choose OpenSearch domain or create new domain
  • Select IAM role (CloudWatch → Lambda → OpenSearch)
  • Lambda blueprint: cloudwatch-logs-process-data handles transformation

Common failure modes:

  • Lambda timeout (default 3 seconds is too short for large batches, increase to 60 seconds)
  • OpenSearch field mapping limit (1,000 fields default, increase to 2,000+)
  • Lambda memory limit (128MB default, increase to 512MB for JSON parsing)
  • Cross-AZ data transfer costs ($0.01/GB if Lambda and OpenSearch are in different AZs)

Alternatives That Combine Managed Convenience with Full Search Power

If CloudWatch Logs is too limited and OpenSearch is too heavy, consider platforms that give you managed log ingestion with full search capability and no cluster management.

CubeAPM

Deployment: Self-hosted in your AWS VPC or data center, managed by CubeAPM team Pricing: $0.15/GB ingested, unlimited users, unlimited retention Best for: Teams that want OpenSearch-level search power without managing OpenSearch clusters

CubeAPM runs inside your infrastructure but is managed like SaaS. It collects logs from CloudWatch via subscription filters or directly from applications using OpenTelemetry, Fluent Bit, or Logstash. Logs are indexed instantly with high cardinality search, full-text filtering, and trace correlation. No cluster sizing, no shard management, no field mapping limits. Data never leaves your VPC. Pricing is flat $0.15/GB with no per-host or per-user fees. A team ingesting 30TB/month pays $4,500/month with unlimited retention and full observability stack (APM, logs, infrastructure, Kubernetes).

Grafana Loki

Deployment: Self-hosted Pricing: Open source, free Best for: Teams that want logs alongside Prometheus metrics

Loki is a log aggregation system designed for Prometheus users. It indexes log metadata (labels) but not log content, making it cheaper to run than OpenSearch. Queries are slower than OpenSearch but faster than CloudWatch Logs. Loki works well for teams already using Grafana for metrics visualization. Storage cost depends on S3 or local disk configuration. Requires moderate operational overhead (configuring compactor, retention policies, and ingester scaling).

Migration Decision Framework: CloudWatch Logs to OpenSearch

If you are considering migrating from CloudWatch Logs to OpenSearch, use this decision tree:

Step 1: Calculate your current CloudWatch Logs cost

  • Ingestion: $0.50/GB × monthly volume
  • Storage: $0.03/GB/month × retention in GB
  • Query: $0.005/GB × query volume

Step 2: Estimate OpenSearch cluster cost

  • Use AWS OpenSearch pricing calculator: https://aws.amazon.com/opensearch-service/pricing/
  • Model compute: 3 nodes minimum for production (m6g.large to m6g.2xlarge)
  • Model storage: retention period × monthly volume × $0.10/GB EBS

Step 3: Compare total cost

If OpenSearch cost is higher but you need deep search, proceed

If OpenSearch cost is lower and you have DevOps resources, proceed

If cost is similar but operational overhead is high, consider managed alternatives

Step 4: Test with a non-critical log group

  • Stream one log group to OpenSearch using subscription filter
  • Build dashboards, test queries, validate alerting
  • Measure Lambda costs, data transfer costs, and cluster performance

Step 5: Expand gradually

  • Migrate log groups one by one
  • Keep CloudWatch Logs as backup for 30 days during transition
  • Monitor OpenSearch cluster health (CPU, heap, shard count)

Frequently Asked Questions

Should I use CloudWatch Logs or OpenSearch for Lambda logs?

CloudWatch Logs is simpler for Lambda. Logs are written automatically with zero configuration. Use CloudWatch if you only need recent logs and basic queries. Use OpenSearch if you need long retention or want to correlate Lambda logs with other services in custom dashboards.

Can I use both CloudWatch Logs and OpenSearch together?

Yes. Most teams use CloudWatch for ingestion and stream logs to OpenSearch for analysis. CloudWatch collects logs from all AWS services automatically. OpenSearch provides deep search and visualization. This pattern is common in production.

How do I reduce CloudWatch Logs costs?

Move logs to Infrequent Access tier after 30 days to cut storage cost by 66%. Filter logs at the source to reduce ingestion volume. Use metric filters instead of querying raw logs repeatedly. Delete old log groups that are no longer needed.

What happens if OpenSearch cluster runs out of disk space?

Log ingestion fails with HTTP 429 errors. OpenSearch stops accepting new data when disk usage exceeds 90%. Solution: expand EBS volume or delete old indices. Set up index lifecycle policies to automatically delete indices older than retention period.

How do I search CloudWatch Logs and OpenSearch at the same time?

You cannot query both directly. Use a unified observability platform that ingests from CloudWatch and provides a single query interface. Alternatively, stream CloudWatch Logs to OpenSearch and query OpenSearch only.

Is OpenSearch better than Elasticsearch for AWS logs?

OpenSearch is a fork of Elasticsearch 7.10. Feature parity is similar for log ingestion and search. OpenSearch has tighter AWS integration (IAM authentication, VPC endpoints). Elasticsearch Cloud (Elastic managed service) costs more than AWS OpenSearch Service. For AWS-native teams, OpenSearch is the better choice.

Can I migrate from OpenSearch back to CloudWatch Logs?

Yes, but you lose all historical data in OpenSearch unless you re-ingest it into CloudWatch (which is expensive at $0.50/GB). You can run both in parallel during transition. Reconfigure log sources to write to CloudWatch instead of OpenSearch subscription filters.

Disclaimer: The information in this article reflects the latest details available at the time of publication and may change as technologies and products evolve. Features, pricing, and plan limits can change over time. Always verify the latest information directly with the vendor before making purchasing or deployment decisions.

×
×