

# CDN integration log analysis and error code reference for MediaTailor
<a name="cdn-log-error-reference"></a>

AWS Elemental MediaTailor content delivery network (CDN) integration logs provide valuable insights into performance and errors. This guide covers both CDN logs (from your content delivery network) and MediaTailor logs and error codes that are relevant to CDN integration troubleshooting. Use this reference when you need to understand what your content delivery network logs and error codes are telling you about your MediaTailor integration. This guide helps you interpret log entries and error messages to identify the root cause of issues.

**Related topics:**
+ For step-by-step troubleshooting procedures, see [Troubleshoot CDN integration](cdn-troubleshooting.md)
+ For proactive monitoring and prevention strategies, see [Monitor MediaTailor CDN operations and performance](cdn-monitoring.md)
+ For escalation and getting additional help, see [Get CDN integration support](cdn-get-help.md)
+ For comprehensive MediaTailor logging configuration and resources, see [MediaTailor logging configuration resources](#mediatailor-logging-resources)
+ For CloudFront log format reference, see [CloudFront access log format](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html#LogFileFormat)
+ For HTTP status code reference, see [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)

# CDN log interpretation and analysis techniques for MediaTailor
<a name="cdn-log-interpretation"></a>

AWS Elemental MediaTailor content delivery network (CDN) integration generates detailed logs that help you understand request patterns and identify issues. When analyzing content delivery network logs, focus on these key indicators:

**Note:** The following examples use Amazon CloudFront terminology. Other CDN providers may use different terms for similar concepts.

HTTP status codes  
+ `200` - Successful request
+ `404` - Resource not found (check routing rules and MediaTailor configuration)
+ `403` - Access denied (check CDN security settings and origin permissions)
+ `502/503/504` - Origin server errors (check MediaTailor service health and origin connectivity)

Cache behavior indicators  
+ `Hit` - Content served from CDN cache
+ `Miss` - Content fetched from origin
+ `RefreshHit` - Cached content validated with origin
+ `Error` - Request resulted in an error

Request patterns to monitor  
+ Manifest requests should typically result in `Miss` or `RefreshHit` due to low TTL settings
+ Content segments should show `Hit` for popular content
+ Ad segments may show `Miss` due to personalization

**Service health monitoring**

When analyzing CDN logs and troubleshooting issues, check MediaTailor service health to determine if problems are service-related:

AWS Service Health Dashboard  
Check current MediaTailor service status and any ongoing service events  
Access: [AWS Service Health Dashboard](https://status.aws.amazon.com/)  
Use this when: You see widespread 5xx errors or service timeouts in CDN logs

AWS Personal Health Dashboard  
View account-specific service health notifications and maintenance events  
Access: [AWS Personal Health Dashboard](https://console.aws.amazon.com/phd/home)  
Use this when: You need account-specific service health information or maintenance notifications

Amazon CloudWatch metrics monitoring  
Monitor MediaTailor service health indicators through CloudWatch metrics:  
+ `GetManifest.Errors` - Track manifest generation errors
+ `GetManifest.Latency` - Monitor response time performance
+ `AdDecisionServer.Errors` - Monitor ad server connectivity issues
+ `Origin.Errors` - Track origin server connectivity problems
Access: [CloudWatch Console](https://console.aws.amazon.com/cloudwatch/home)  
Use this when: You need detailed service performance metrics and historical trends

**Service health troubleshooting workflow:**

1. Check AWS Service Health Dashboard for current service status

1. Review AWS Personal Health Dashboard for account-specific notifications

1. Monitor CloudWatch metrics for service performance indicators

1. Correlate service health status with CDN log patterns and error rates

1. If service health is normal, focus on CDN configuration and origin server issues

**CDN log analysis resources**
+ [CloudFront access logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html) - Complete guide to CDN log format and fields
+ [CloudFront real-time logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html) - Real-time log streaming and analysis
+ [Analyzing log data with CloudWatch Logs Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html) - Advanced log querying and analysis
+ [Monitor workload resources](https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/monitor-workload-resources.html) - Well-Architected monitoring patterns

**Topics**
+ [CDN log interpretation](cdn-log-interpretation.md)
+ [Error codes reference](emt-error-codes-reference.md)
+ [Log analysis tools](log-analysis-techniques.md)
+ [

## MediaTailor logging configuration resources
](#mediatailor-logging-resources)

# MediaTailor error codes and CDN integration troubleshooting
<a name="emt-error-codes-reference"></a>

AWS Elemental MediaTailor error codes provide specific information about integration issues when passed through your content delivery network (CDN). When MediaTailor returns errors through your content delivery network, these codes indicate specific issues:

**Note:** These error codes are returned by MediaTailor and passed through your CDN. For CDN-specific errors, consult your CDN provider's documentation.

400 Bad Request  
**Common causes:** Malformed query parameters, missing required parameters, invalid session IDs  
**Check:** CDN query string forwarding configuration, parameter encoding

403 Forbidden  
**Common causes:** Client player requesting a segment that does not exist or lacks permission to access. For ad segments, MediaTailor might have specified a non-existent segment (contact [AWS Support](https://aws.amazon.com/premiumsupport/) to investigate). For content segments, origin provider access restrictions or authentication issues  
**Check:** For ad segments: contact [AWS Support](https://aws.amazon.com/premiumsupport/) if MediaTailor is generating invalid segment URLs. For content segments: Verify origin server permissions, authentication credentials, and access policies. Check if segments exist at the requested URLs

404 Not Found  
**Common causes:** MediaTailor configuration doesn't exist or is inactive, incorrect playback URL path, manifest or segment requests to non-existent resources  
**Check:** Verify MediaTailor configuration exists and is active, confirm playback URL matches the `ManifestEndpointPrefix` from `GetPlaybackConfiguration`, check CDN routing rules forward requests to correct MediaTailor endpoints

500 Internal Server Error  
**Common causes:** Origin server issues, ADS connectivity problems, manifest processing errors  
**Check:** Origin server health, ADS response validity, MediaTailor service status

502 Bad Gateway  
**Common causes:** Origin server unreachable, invalid origin response, `UnsupportedManifestException` due to HLS playlist alignment issues (SCTE markers not aligned across playlists, missing SCTE markers on some playlists, inconsistent ad break timing across bitrate variants)  
**Check:** Origin server connectivity and firewall rules, DNS resolution, HLS playlist consistency across all bitrate variants, SCTE-35 marker alignment on same segments across all playlists, verify all playlists contain required ad break markers

**Error code analysis resources:**
+ [Troubleshooting MediaTailor](https://docs.aws.amazon.com/mediatailor/latest/ug/troubleshooting.html) - Complete MediaTailor error code reference
+ [Troubleshooting CloudFront error responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/troubleshooting-response-errors.html) - CDN-specific error analysis
+ [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) - Comprehensive HTTP status code reference
+ [Failure management](https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/failure-management.html) - Well-Architected error handling patterns

# CDN log analysis tools and monitoring techniques for MediaTailor
<a name="log-analysis-techniques"></a>

AWS Elemental MediaTailor content delivery network (CDN) integration generates large volumes of log data that require efficient analysis tools and techniques. Use these approaches to efficiently analyze content delivery network and MediaTailor logs:
+ **Command-line analysis:** Use tools like `grep`, `awk`, and `sort` to filter and analyze log patterns
+ **Amazon CloudWatch Logs Insights:** Query CDN and MediaTailor logs with SQL-like syntax for advanced analysis
+ **Third-party tools:** Consider log analysis platforms for comprehensive monitoring and alerting
+ **Custom dashboards:** Create visualizations that combine CDN metrics with MediaTailor performance data

If you need additional assistance with log analysis or interpreting complex error patterns, see [Get CDN integration support](cdn-get-help.md).

**Log analysis tools and resources:**
+ [CloudWatch Logs Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html) - SQL-like queries for log analysis
+ [Amazon OpenSearch Service](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/what-is.html) - Advanced log search and analytics
+ [CloudWatch dashboards](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html) - Custom visualization and monitoring
+ [Instrumenting distributed systems for operational visibility](https://aws.amazon.com/builders-library/instrumenting-distributed-systems-for-operational-visibility/) - Advanced observability patterns
+ [Design workload observability](https://docs.aws.amazon.com/wellarchitected/latest/operational-excellence-pillar/design-workload-observability.html) - Well-Architected observability guidance

## MediaTailor logging configuration resources
<a name="mediatailor-logging-resources"></a>

In addition to CDN logs, MediaTailor provides comprehensive logging capabilities for monitoring ad insertion, manifest generation, and service interactions. Use these resources to configure and analyze MediaTailor logs:

MediaTailor manifest and service logs  
Configure and analyze logs for manifest generation, origin interactions, and service events:  
+ [AWS Elemental MediaTailor manifest logs description and event types](log-types.md) - Complete reference for MediaTailor manifest logs and event types
+ [Viewing AWS Elemental MediaTailor logs](monitoring-through-logs.md) - Guide to viewing and interpreting MediaTailor logs

Vended logs configuration  
Configure flexible log delivery to multiple destinations with cost optimization:  
+ [Using vended logs to send AWS Elemental MediaTailor logs](vended-logs.md) - Configure log delivery to Amazon S3, Firehose, or CloudWatch Logs
+ [Migrating your AWS Elemental MediaTailor logging strategy](vended-logs-migrate.md) - Migration guide for existing logging configurations

CloudWatch Logs integration  
Integrate MediaTailor logs with CloudWatch for monitoring and analysis:  
+ [Viewing AWS Elemental MediaTailor logs](monitoring-through-logs.md) - CloudWatch Logs configuration and analysis
+ [CloudWatchInsights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html) - Advanced log querying and analysis

Ad-specific logging  
Monitor ad insertion performance and troubleshoot ad-related issues:  
+ ADS interaction logs - Monitor ad decision server communication and errors

**Key differences between CDN and MediaTailor logs:**
+ **CDN logs**: Show request/response patterns, cache behavior, and network-level errors from your content delivery network
+ **MediaTailor logs**: Show ad insertion details, manifest generation events, origin interactions, and service-specific errors
+ **Combined analysis**: Use both log types together for complete visibility into your streaming workflow

For comprehensive monitoring that combines both CDN and MediaTailor logging, see [Monitor MediaTailor CDN operations and performance](cdn-monitoring.md).