

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# AWS Elemental MediaTailor ログの表示
<a name="monitoring-through-logs"></a>

MediaTailor は、チャネルと再生設定のさまざまなマイルストーンとアクティビティを記述するログを出力します。これらのログを使用して、ワークフローを可視化し、サービスの問題をトラブルシューティングできます。以下のトピックでは、ログとログ記録オプションについて説明します。

**Topics**
+ [ADS ログ](ads-log-format.md)
+ [マニフェストログ](log-types.md)
+ [トランスコードログ](tm-log-format.md)
+ [販売ログの使用](vended-logs.md)
+ [CloudWatch Logs へのログの書き込み](monitoring-cw-logs.md)
+ [広告挿入セッションログのボリュームの制御](log-configuration.md)
+ [ログとイベントのフィルタリング](logs-filter.md)
+ [デバッグログの生成](debug-log-mode.md)

# AWS Elemental MediaTailor ADS ログの説明とイベントタイプ
<a name="ads-log-format"></a>

以下のセクションでは、広告決定サーバー (ADS) でイベントを記述するために MediaTailor が出力するログについて説明します。これらは`AdDecisionServerInteractions`ログです。

**Topics**
+ [AdDecisionServerInteractions のイベント](#log-types-adsinteraction)
+ [ADS ログの説明](#ads-log-description)
+ [ADS ログの JSON スキーマ](#ads-log-json-schema)

## AdDecisionServerInteractions のイベント
<a name="log-types-adsinteraction"></a>

MediaTailor と広告決定サーバー (ADS) とのやり取り中に、次のイベントが出力されます。


| Log | 説明 | 
| --- | --- | 
| AD\$1MARKER\$1FOUND | MediaTailor はマニフェストで広告マーカーを見つけました。 | 
| BEACON\$1FIRED | 追跡ビーコンが起動され、広告イベントが報告されました。サーバー側のレポートモード (デフォルト) では、MediaTailor はビーコンを起動します。クライアント側のレポートモードでは、再生デバイスがビーコンを起動します。 | 
| EMPTY\$1VAST\$1RESPONSE | ADS は、ゼロ広告を含む空の VAST レスポンスを返しました。 | 
| EMPTY\$1VMAP\$1RESPONSE | ADS は空の VMAP レスポンスを返しました。 | 
| ERROR\$1ADS\$1INVALID\$1RESPONSE | ADS は 200 以外のステータスコードを返しました。 | 
| ERROR\$1ADS\$1IO | MediaTailor が ADS との通信中にエラーが発生しました。 | 
| ERROR\$1ADS\$1RESPONSE\$1PARSE | MediaTailor で ADS レスポンスの解析中にエラーが発生しました。 | 
| ERROR\$1ADS\$1RESPONSE\$1UNKNOWN\$1ROOT\$1ELEMENT | ADS レスポンスに無効なルート要素が含まれています。 | 
| ERROR\$1ADS\$1TIMEOUT | ADS への MediaTailor リクエストがタイムアウトしました。 | 
| ERROR\$1DISALLOWED\$1HOST | ADS ホストは許可されていません。 | 
| ERROR\$1FIRING\$1BEACON\$1FAILED | MediaTailor が追跡ビーコンの発射に失敗しました。 | 
| ERROR\$1PERSONALIZATION\$1DISABLED | このセッションでは、広告挿入は無効になっています。 | 
| ERROR\$1UNKNOWN | MediaTailor で ADS リクエスト中に不明なエラーが発生しました。 | 
| ERROR\$1UNKNOWN\$1HOST | ADS ホストが不明です。 | 
| ERROR\$1VAST\$1INVALID\$1MEDIA\$1FILE | VAST に無効または欠落しているMediaFile要素Adがあります。 | 
| ERROR\$1VAST\$1INVALID\$1VAST\$1AD\$1TAG\$1URI | VAST レスポンスに無効な が含まれていますVASTAdTagURI。 | 
| ERROR\$1VAST\$1MISSING\$1CREATIVES | VAST にはゼロまたは複数のCreatives要素Adが含まれています。1 つのCreatives要素が必要です。 | 
| ERROR\$1VAST\$1MISSING\$1IMPRESSION | VAST にはゼロImpression要素Adが含まれています。少なくとも 1 つのImpression要素が必要です。 | 
| ERROR\$1VAST\$1MISSING\$1MEDIAFILES | VAST にはゼロまたは複数のMediaFiles要素Adが含まれています。1 つのMediaFiles要素が必要です。 | 
| ERROR\$1VAST\$1MISSING\$1OVERLAYS | MediaTailor は、広告サーバーから非線形クリエイティブを受け取りませんでした。 | 
| ERROR\$1VAST\$1MULTIPLE\$1LINEAR | VAST には複数のLinear要素Adが含まれています。 | 
| ERROR\$1VAST\$1MULTIPLE\$1TRACKING\$1EVENTS | VAST には複数のTrackingEvents要素Adが含まれています。 | 
| ERROR\$1VAST\$1REDIRECT\$1EMPTY\$1RESPONSE | VAST リダイレクトリクエストが空のレスポンスを返しました。 | 
| ERROR\$1VAST\$1REDIRECT\$1FAILED | VAST リダイレクトリクエストでエラーが発生しました。 | 
| ERROR\$1VAST\$1REDIRECT\$1MULTIPLE\$1VAST | VAST リダイレクトリクエストは複数の広告を返しました。 | 
| FILLED\$1AVAIL | MediaTailor は avail を正常に入力しました。 | 
| FILLED\$1OVERLAY\$1AVAIL | MediaTailor はオーバーレイ表示を正常に塗りつぶしました。 | 
| INTERSTITIAL\$1VOD\$1FAILURE | ADS リクエストまたはレスポンスで、VOD プレイリストのインタースティシャル表示のフィル中に問題が発生しました。広告は挿入されません。 | 
| INTERSTITIAL\$1VOD\$1SUCCESS | MediaTailor が VOD プレイリストのインタースティシャル表示を正常に入力しました。 | 
| MAKING\$1ADS\$1REQUEST | MediaTailor は ADS に広告をリクエストしています。 | 
| MODIFIED\$1TARGET\$1URL | MediaTailor がアウトバウンドターゲット URL を変更しました。 | 
| NON\$1AD\$1MARKER\$1FOUND | MediaTailor はマニフェストで実行不可能な広告マーカーを見つけました。 | 
| RAW\$1ADS\$1RESPONSE | MediaTailor は raw ADS レスポンスを受信しました。 | 
| REDIRECTED\$1VAST\$1RESPONSE | MediaTailor は、VAST リダイレクトの後、VAST レスポンスを受信しました。 | 
| VAST\$1REDIRECT | VAST 広告レスポンスにはリダイレクトが含まれています。 | 
| VAST\$1RESPONSE | MediaTailor は VAST レスポンスを受信しました。 | 
| VOD\$1TIME\$1BASED\$1AVAIL\$1PLAN\$1SUCCESS | MediaTailor は、VOD テンプレートの時間ベースの可用性プランを正常に作成しました。 | 
| VOD\$1TIME\$1BASED\$1AVAIL\$1PLAN\$1VAST\$1RESPONSE\$1FOR\$1OFFSET | MediaTailor は、VOD テンプレートの時間ベースの可用性プランを作成しています。MediaTailor は、タイムオフセットの VAST レスポンスを受信しました。 | 
| VOD\$1TIME\$1BASED\$1AVAIL\$1PLAN\$1WARNING\$1NO\$1ADVERTISEMENTS | ADS リクエストまたはレスポンスで、VOD テンプレートの時間ベースの可用性プランの作成中に問題が発生しました。広告は挿入されません。 | 
| WARNING\$1NO\$1ADVERTISEMENTS | MediaTailor で、表示のフィル中に問題が発生しました。広告は挿入されません。 | 
| WARNING\$1URL\$1VARIABLE\$1SUBSTITUTION\$1FAILED | MediaTailor は、ADS URL の動的変数を置き換えることはできません。URL 設定を確認します。 | 
| WARNING\$1VPAID\$1AD\$1DROPPED | スレートの欠落により VPAID 広告がドロップされたか、セッションがサーバー側のレポートを使用します。 | 

## ADS ログの説明
<a name="ads-log-description"></a>

このセクションでは、ADS ログの説明の構造と内容について説明します。JSON エディタで独自に調べるには、[ADS ログの JSON スキーマ](#ads-log-json-schema) のリストを使用します。

ADS ログの各イベントには、CloudWatch Logs によって生成された標準フィールドが含まれています。詳細については、「[CloudWatch Logs Insights を使用したログデータの分析](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html)」を参照してください。

### ADS ログのプロパティ
<a name="ads-logs-main"></a>

このセクションでは、ADS ログのプロパティについて説明します。


| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| adsRequestUrl | string | false | MediaTailor によって行われた ADS リクエストの完全な URL。 | 
| avail | [avail](#ads-logs-avail) 型のオブジェクト | false | MediaTailor が広告で埋め込む avail に関する情報。現在、 FILLED\$1AVAIL イベントタイプの場合、これは MediaTailor が最初に avail を検出したときに MediaTailor によって作成されたプランです。最終的に avail がどのように満たされるかは、コンテンツの再生方法に応じて、このプランとは異なる場合があります。 | 
| awsAccountId | string | true | セッションに使用された MediaTailor 設定の AWS アカウント ID。 | 
| customerId | string | true | 複数のログエントリを関連付けるために使用できる AWS アカウント ID のハッシュ化されたバージョン。 | 
| eventDescription | string | true | MediaTailor サービスによって提供される、このログメッセージをトリガーしたイベントの簡単な説明。デフォルトでは、これは空です。例えば、Got VAST response などです。 | 
| eventTimestamp | string | true | リクエストの日付と時刻。 | 
| eventType | string | true | このログメッセージをトリガーしたイベントのコード。例えば、VAST\$1RESPONSE などです。 | 
| originId | string | true | MediaTailor 設定からの設定名。これは、同じく設定の一部である動画コンテンツソースとは異なります。 | 
| prefetchScheduleName | string | false | この広告イベントに関連付けられたプリフェッチスケジュールの名前。 | 
| requestHeaders | [requestheaders](#ads-logs-requestheaders) 型の配列 | false | MediaTailor が ADS リクエストに含めたヘッダー。通常、ADS へのリクエストが失敗するとログに含まれるもので、トラブルシューティングに役立ちます。 | 
| requestId | string | true | MediaTailor リクエスト ID。同じリクエストの複数のログエントリを関連付けるために使用できます。 | 
| sessionId | string | true | MediaTailor がプレイヤーセッションに割り当てた一意の数値識別子。プレイヤーがセッションに対して行うすべてのリクエストは、同じセッション ID を持ちます。例えば、e039fd39-09f0-46b2-aca9-9871cc116cde などです。 | 
| sessionType | string (有効な値: [DASH, HLS]) | true | プレイヤーのストリームタイプ。 | 
| vastAd | [vastAd](#ads-logs-vastAd) 型のオブジェクト | false | VAST レスポンスから解析された 1 つの広告に関する情報。 | 
| vastResponse | [vastResponse](#ads-logs-vastResponse) 型のオブジェクト | false | MediaTailor が ADS から受け取った VAST レスポンスに関する情報。 | 
| vodCreativeOffsets | [vodCreativeOffsets](#ads-logs-vodCreativeOffsets) 型のオブジェクト | false | VMAP レスポンスに基づいて、MediaTailor が avail を挿入するマニフェスト内の時間オフセットを示すマップ。 | 
| vodVastResponseTimeOffset | 数値 | false | VOD 広告挿入の VMAP 固有の時間オフセット。 | 

### adContent
<a name="ads-logs-adContent"></a>

このセクションでは、ADS ログ adContent のプロパティについて説明します。


**ADS ログ adContent プロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| adPlaylistUris | [adPlaylistUris](#ads-logs-adPlaylistUris) 型のオブジェクト | false | バリアントのオリジンマニフェストからバリアントの広告マニフェストへのマッピング。DASH の場合、これには 1 つのエントリが含まれます。すべてのバリアントが 1 つの DASH マニフェストで表されるためです。 | 

### adPlaylistUris
<a name="ads-logs-adPlaylistUris"></a>

このセクションでは、ADS ログ adPlaylistUris のプロパティについて説明します。


**ADS ログ adPlaylistUris プロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| <any string> | string | false | 特定のバリアントの広告マニフェストの URL。 | 

### avail
<a name="ads-logs-avail"></a>

このセクションでは、ADS ログ avail のプロパティについて説明します。


**ADS ログ avail プロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| availId | string | true | この avail の一意の識別子。HLS の場合、これは avail が開始される位置のメディアシーケンス番号です。DASH の場合、これは期間 ID です。 | 
| creativeAds | [creativeAd](#ads-logs-creativeAd) 型の配列 | true | MediaTailor が avail に挿入した広告。 | 
| fillRate | 数値 | true | 広告が avail 継続時間を埋めるレート。0.0（0% の場合）から 1.0（100% の場合）です。 | 
| filledDuration | 数値 | true | Avail に挿入されたすべての広告の継続時間の合計。 | 
| numAds | 数値 | true | MediaTailor が avail に挿入した広告の数。 | 
| originAvailDuration | 数値 | true | オリジンからのコンテンツストリームで指定された avail の継続時間 (CUE\$1OUT または SCTE)。 | 
| skippedAds | [skippedAd](#ads-logs-skippedAd) 型の配列 | false | MediaTailor が挿入しなかった広告 TRANSCODE\$1IN\$1PROGRESS やなど TRANSCODE\$1ERROR。スキップされた広告理由のリストについては、「」を参照してください[広告スキップのトラブルシューティング](troubleshooting-ad-skipping-overview.md)。 | 
| slateAd | [slateAd](#ads-logs-slateAd) 型のオブジェクト | true | MediaTailor が avail の未入力セグメントを埋めるために使用するスレート広告に関する情報。 | 

### creativeAd
<a name="ads-logs-creativeAd"></a>

このセクションでは、ADS ログ creativeAd のプロパティについて説明します。


**ADS ログ creativeAd プロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| adContent | [adContent](#ads-logs-adContent) 型のオブジェクト | true | 挿入された広告のコンテンツに関する情報。 | 
| creativeUniqueId | string | true | トランスコーディングのキーとして使用される、広告の一意の識別子。使用可能な場合、これは、VAST レスポンス内のクリエイティブの ID フィールドです。それ以外の場合は、広告のメザニン URL です。 | 
| trackingEvents | [trackingEvents](#ads-logs-trackingEvents) 型のオブジェクト | true | 広告のさまざまな追跡イベントの追跡ビーコン URL。キーはイベント名であり、値はビーコン URL のリストです。 | 
| transcodedAdDuration | 数値 | true | トランスコードされたアセットから計算された広告の継続時間。 | 
| uri | string | true | トランスコーダーへの入力であるメザニンバージョンの広告の URL。 | 
| vastDuration | 数値 | true | VAST レスポンスから解析された広告の継続時間。 | 

### requestheaders
<a name="ads-logs-requestheaders"></a>

このセクションでは、ADS ログの requestheaders のプロパティについて説明します。


**ADS ログの requestheaders のプロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| name | string | true | ヘッダーの名前。 | 
| value | string | true | ヘッダーの値 | 

### skippedAd
<a name="ads-logs-skippedAd"></a>

このセクションでは、ADS ログ skippedAd のプロパティについて説明します。


**ADS ログ skippedAd のプロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| adMezzanineUrl | string | true | スキップされた広告のメザニン URL。 | 
| creativeUniqueId | string | true | トランスコーディングのキーとして使用される、広告の一意の識別子。使用可能な場合、これは、VAST レスポンス内のクリエイティブの ID フィールドです。それ以外の場合は、広告のメザニン URL です。 | 
| skippedReason | string | true | 広告が挿入されなかった理由を示すコード。例えば、TRANSCODE\$1IN\$1PROGRESS などです。スキップされた広告理由のリストについては、「」を参照してください[広告スキップのトラブルシューティング](troubleshooting-ad-skipping-overview.md)。 | 
| transcodedAdDuration | 数値 | false | トランスコードされたアセットから計算された広告の継続時間。 | 
| vastDuration | 数値 | true | VAST レスポンスから解析された広告の継続時間。 | 

### slateAd
<a name="ads-logs-slateAd"></a>

このセクションでは、ADS ログ slateAd のプロパティについて説明します。


**ADS ログ slateAd のプロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| adContent | [adContent](#ads-logs-adContent) 型のオブジェクト | true | 挿入された広告のコンテンツに関する情報。 | 
| creativeUniqueId | string | true | トランスコーディングのキーとして使用される、広告の一意の識別子。使用可能な場合、これは、VAST レスポンス内のクリエイティブの ID フィールドです。それ以外の場合は、広告のメザニン URL です。 | 
| transcodedAdDuration | 数値 | true | トランスコードされたアセットから計算された広告の継続時間。 | 
| uri | string | true | トランスコーダーへの入力であるメザニンバージョンの広告の URL。 | 

### trackingEvents
<a name="ads-logs-trackingEvents"></a>

このセクションでは、ADS ログ trackingEvents のプロパティについて説明します。


**ADS ログ trackingEvents のプロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| <any string> | 文字列型の配列 | false | 指定された追跡イベントのビーコン URL のリスト (インプレッション、完了など) | 

### vastAd
<a name="ads-logs-vastAd"></a>

このセクションでは、ADS ログ vastAd のプロパティについて説明します。


**ADS ログ vastAd のプロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| adSystem | string | true | VAST レスポンスの AdSystem タグの値。 | 
| adTitle | string | true | VAST レスポンスで広告に使用できるメディアファイル。 | 
| creativeAdId | string | true | VAST レスポンスの Creative タグの adId 属性の値。 | 
| creativeId | string | true | VAST レスポンスの Creative タグの id 属性の値。 | 
| duration | 数値 | true | VAST レスポンスの duration 要素の linear タグに基づく、広告のおおよその継続時間。 | 
| trackingEvents | [trackingEvents](#ads-logs-trackingEvents) 型のオブジェクト | true | 広告のさまざまな追跡イベントの追跡ビーコン URL。キーはイベント名であり、値はビーコン URL のリストです。 | 
| vastAdId | string | true | VAST レスポンスの Ad タグの id 属性の値 | 
| vastAdTagUri | string | false | 広告の VMAP 固有のリダイレクト URI。 | 
| vastMediaFiles | [vastMediaFile](#ads-logs-vastMediaFile) 型の配列 | true | VAST レスポンスの広告に使用可能なメディアファイルのリスト。 | 

### vastMediaFile
<a name="ads-logs-vastMediaFile"></a>

このセクションでは、ADS ログ vastMediaFile のプロパティについて説明します。


**ADS ログ vastMediaFile のプロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| apiFramework | string | true | メディアファイルの管理に必要な API フレームワーク。例えば、VPAID などです。 | 
| bitrate | 数値 | true | メディアファイルのビットレート。 | 
| delivery | string | true | メディアファイルに使用されるプロトコル。プログレッシブまたはストリーミングのいずれかに設定されます。 | 
| height | 数値 | true | メディアファイルのピクセルの高さ。 | 
| id | string | true | MediaFile タグの id 属性の値。 | 
| type | string | true | MediaFile タグの type 属性から取得されたメディアファイルの MIME タイプ。 | 
| uri | string | true | トランスコーダーへの入力であるメザニンバージョンの広告の URL。 | 
| width | 数値 | true | メディアファイルのピクセル幅。 | 

### vastResponse
<a name="ads-logs-vastResponse"></a>

このセクションでは、ADS ログ vastResponse のプロパティについて説明します。


**ADS ログ vastResponse のプロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| errors | 文字列型の配列 | true | VAST レスポンスの Error タグから解析されたエラー URL。 | 
| vastAds | [vastAd](#ads-logs-vastAd) 型の配列 | true | VAST レスポンスから解析された広告。 | 
| version | string | true | レスポンスの VAST タグの version 属性から解析された VAST 仕様バージョン。 | 

### vodCreativeOffsets
<a name="ads-logs-vodCreativeOffsets"></a>

このセクションでは、ADS ログ vodCreativeOffsets のプロパティについて説明します。


**ADS ログ vodCreativeOffsets のプロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| <any string> | [vodCreativeOffset](#ads-logs-vodCreativeOffset) 型の配列 | false | マニフェストの時間オフセットから、この時点で挿入する広告のリストへのマッピング。 | 

### vodCreativeOffset
<a name="ads-logs-vodCreativeOffset"></a>

このセクションでは、ADS ログ vodCreativeOffset のプロパティについて説明します。


**ADS ログ vodCreativeOffset のプロパティ**  

| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| adContent | [adContent](#ads-logs-adContent) 型のオブジェクト | true | 挿入された広告のコンテンツに関する情報。 | 
| creativeUniqueId | string | true | トランスコーディングのキーとして使用される、広告の一意の識別子。使用可能な場合、これは、VAST レスポンス内のクリエイティブの ID フィールドです。それ以外の場合は、広告のメザニン URL です。 | 
| trackingEvents | [trackingEvents](#ads-logs-trackingEvents) 型のオブジェクト | true | 広告のさまざまな追跡イベントの追跡ビーコン URL。キーはイベント名であり、値はビーコン URL のリストです。 | 
| transcodedAdDuration | 数値 | true | トランスコードされたアセットから計算された広告の継続時間。 | 
| uri | string | true | トランスコーダーへの入力であるメザニンバージョンの広告の URL。 | 
| vastDuration | 数値 | true | VAST レスポンスから解析された広告の継続時間。 | 

## ADS ログの JSON スキーマ
<a name="ads-log-json-schema"></a>

ADS ログの JSON AWS Elemental MediaTailor スキーマを以下に示します。

```
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://amazon.com/elemental/midas/mms/adsLogSchema.json",
  "type": "object",
  "title": "AWS Elemental MediaTailor ADS Log JSON Schema",
  "required": [
    "eventType",
    "eventTimestamp",
    "requestId",
    "sessionType",
    "eventDescription",
    "awsAccountId",
    "customerId",
    "originId",
    "sessionId"
  ],
  "additionalProperties": false,
  "properties": {
    "eventType": {
      "$id": "#/properties/eventType",
      "type": "string",
      "description": "The code for the event that triggered this log message. Example: <code>VAST_RESPONSE</code>.",
      "examples": [
        "FILLED_AVAIL"
      ]
    },
    "eventTimestamp": {
      "$id": "#/properties/eventTimestamp",
      "type": "string",
      "description": "The date and time of the event.",
      "examples": [
        "1970-01-01T00:00:00Z"
      ],
      "format": "date-time"
    },
    "requestId": {
      "$id": "#/properties/requestId",
      "type": "string",
      "description": "The MediaTailor request ID, which you can use to correlate multiple log entries for the same request.",
      "examples": [
        "c7c7ae8c-a61e-44e0-8efd-7723995337a1"
      ],
      "pattern": "^(.*)$"
    },
    "sessionType": {
      "$id": "#/properties/sessionType",
      "type": "string",
      "enum": [
        "HLS",
        "DASH"
      ],
      "description": "The player's stream type."
    },
    "eventDescription": {
      "$id": "#/properties/eventDescription",
      "type": "string",
      "description": "A short description of the event that triggered this log message, provided by the MediaTailor service. By default, this is empty. Example: <code>Got VAST response</code>.",
      "default": "",
      "examples": [
        "Got VAST response"
      ],
      "pattern": "^(.*)$"
    },
    "awsAccountId": {
      "$id": "#/properties/awsAccountId",
      "type": "string",
      "description": "The AWS account ID for the MediaTailor configuration that was used for the session."
    },
    "customerId": {
      "$id": "#/properties/customerId",
      "type": "string",
      "description": "The hashed version of the AWS account ID, which you can use to correlate multiple log entries.",
      "pattern": "^(.*)$"
    },
    "originId": {
      "$id": "#/properties/originId",
      "type": "string",
      "description": "The configuration name from the MediaTailor configuration. This is different from the video content source, which is also part of the configuration.",
      "examples": [
        "external-canary-dash-serverside-reporting-onebox"
      ],
      "pattern": "^(.*)$"
    },
    "sessionId": {
      "$id": "#/properties/sessionId",
      "type": "string",
      "description": "The unique numeric identifier that MediaTailor assigned to the player session. All requests that a player makes for a session have the same session ID. Example: <code>e039fd39-09f0-46b2-aca9-9871cc116cde</code>.",
      "examples": [
        "120b9873-c007-40c8-b3db-0f1bd194970b"
      ],
      "pattern": "^(.*)$"
    },
    "avail": {
      "$id": "#/properties/avail",
      "type": "object",
      "title": "avail",
      "description": "Information about an avail that MediaTailor fills with ads. Currently, for the <code>FILLED_AVAIL</code> event type, this is the plan created by MediaTailor when it first encounters the avail. How the avail is eventually filled may vary from this plan, depending on how the content plays out.  ",
      "required": [
        "creativeAds",
        "originAvailDuration",
        "filledDuration",
        "fillRate",
        "driftMillisecondsAtAvailStart",
        "numAds",
        "slateAd",
        "availId"
      ],
      "additionalProperties":  false,
      "properties": {
        "originAvailDuration": {
          "$id": "#/properties/avail/originAvailDuration",
          "type": "number",
          "description": "The duration of the avail as specified in the content stream from the origin (<code>CUE_OUT</code> or <code>SCTE</code>)."
        },
        "filledDuration": {
          "$id": "#/properties/avail/filledDuration",
          "type": "number",
          "description": "The sum of the durations of all the ads inserted into the avail."
        },
        "fillRate": {
          "$id": "#/properties/avail/fillRate",
          "type": "number",
          "description": "The rate at which the ads fill the avail duration, from 0.0 (for 0%) to 1.0 (for 100%)."
        },
        "driftMillisecondsAtAvailStart": {
          "$id": "#/properties/avail/driftMillisecondsAtAvailStart",
          "type": "number",
          "description": "The cumulative drift at the beginning of this avail. A positive value implies that we are moving away from the live edge, a negative value implies that we are moving towards the live edge."
        },
        "creativeAds": {
          "$id": "#/properties/avail/creativeAds",
          "type": "array",
          "description": "The ads that MediaTailor inserted into the avail.",
          "items": {
            "type": "object",
            "title": "creativeAd",
            "description": "Information about a single inserted ad.",
            "required": [
              "uri",
              "creativeUniqueId",
              "adSystem",
              "adContent",
              "trackingEvents",
              "vastDuration",
              "transcodedAdDuration"
            ],
            "additionalProperties": false,
            "properties": {
              "uri": { "$ref": "#/definitions/adMezzanineUri" },
              "creativeUniqueId": { "$ref": "#/definitions/creativeUniqueId" },
              "adSystem": { "$ref": "#/definitions/adSystem" },
              "adContent": { "$ref": "#/definitions/adContent" },
              "trackingEvents": { "$ref": "#/definitions/trackingEvents" },
              "vastDuration": { "$ref": "#/definitions/vastDuration" },
              "transcodedAdDuration": { "$ref": "#/definitions/transcodedAdDuration" }
            }
          }
        },
        "numAds": {
          "$id": "#/properties/avail/numAds",
          "type": "number",
          "description": "The number of ads that MediaTailor inserted into the avail."
        },
        "slateAd": {
          "$id": "#/properties/avail/slateAd",
          "type": ["object", "null"],
          "title": "slateAd",
          "description": "Information about the slate ad, which MediaTailor uses to fill any unfilled segments in the avail.",
          "additionalProperties": false,
          "required": [
            "uri",
            "creativeUniqueId",
            "adContent",
            "transcodedAdDuration"
          ],
          "properties": {
            "uri": { "$ref": "#/definitions/adMezzanineUri" },
            "creativeUniqueId": { "$ref": "#/definitions/creativeUniqueId" },
            "adContent": { "$ref": "#/definitions/adContent" },
            "transcodedAdDuration": { "$ref": "#/definitions/transcodedAdDuration" }
          }
        },
        "availId": {
          "$id": "#/properties/avail/availId",
          "type": "string",
          "description": "The unique identifier for this avail. For HLS, this is the media sequence number where the avail begins. For DASH, this is the period ID."
        },
        "skippedAds": {
          "$id": "#/properties/avail/skippedAds",
          "type": "array",
          "description": "The ads that MediaTailor didn't insert, for reasons like <code>TRANSCODE_IN_PROGRESS</code> and <code>TRANSCODE_ERROR</code>.",
          "items": {
            "type": "object",
            "title": "skippedAd",
            "description": "Information about a single skipped ad.",
            "required": [
              "creativeUniqueId",
              "adMezzanineUrl",
              "skippedReason",
              "vastDuration"
            ],
            "additionalProperties": false,
            "properties": {
              "creativeUniqueId": { "$ref": "#/definitions/creativeUniqueId" },
              "adMezzanineUrl": {
                "type": "string",
                "description": "The mezzanine URL of the skipped ad."
              },
              "skippedReason": {
                "type": "string",
                "description": "The code that indicates why the ad wasn't inserted. Example: <code>TRANSCODE_IN_PROGRESS</code>."
              },
              "vastDuration": { "$ref": "#/definitions/vastDuration" },
              "transcodedAdDuration": { "$ref": "#/definitions/transcodedAdDuration" },
              "targetVariant": {
                "type": "object",
                "title": "targetVariant",
                "description": "The target variant of the source content. This key is present when an ad wasn't inserted due to the source content containing a variant that could not match to any variants present in this ad.",
                "required": [
                  "mediaProtocol",
                  "mediaType",
                  "bitrate",
                  "mediaResolution",
                  "codecs"
                ],
                "additionalProperties": false,
                "properties": {
                  "mediaProtocol": {
                    "type": "string",
                    "description": "The media protocol of this variant, such as HLS.",
                    "enum": [
                      "HLS",
                      "DASH"
                    ]
                  },
                  "mediaType": {
                    "type": "array",
                    "description": "The media type of this variant, such as VIDEO.",
                    "items": {
                      "type": "string",
                      "enum": [
                        "VIDEO",
                        "AUDIO",
                        "SUBTITLES",
                        "TRICK_PLAY"
                      ],
                      "description": "Media type, such as VIDEO."
                    }
                  },
                  "bitrate": {
                    "$ref": "#/definitions/bitrate"
                  },
                  "mediaResolution": {
                    "type": "object",
                    "title": "mediaResolution",
                    "description": "The media resolution of this variant.",
                    "required": [
                      "width",
                      "height"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "width": {
                        "$ref": "#/definitions/width"
                      },
                      "height": {
                        "$ref": "#/definitions/height"
                      }
                    }
                  },
                  "codecs": {
                    "type": "array",
                    "description": "The codecs of this variant.",
                    "items": {
                      "type": "string",
                      "description": "Codec, such as avc1."
                    }
                  }
                }
              }
            }
          }
        },
        "adBreakTrackingEvents": {
          "$id": "#properties/avail/adBreakTrackingEvents",
          "type": "object",
          "title": "adBreakTrackingEvents",
          "description": "VMAP/ad break tracking events and corresponding URL",
          "properties": {
            "items": {
              "$ref": "#/definitions/adBreakTrackingEvents"
            }
          }
        }
      }
    },

    "vastResponse": {
      "$id": "#/properties/vastResponse",
      "type": "object",
      "title": "vastResponse",
      "description": "Information about the VAST response that MediaTailor received from the ADS.",
      "required": [
        "version",
        "vastAds",
        "errors",
        "nonLinearAdsList"
      ],
      "additionalProperties":  false,
      "properties": {
        "version": {
          "$id": "#/properties/vastResponse/version",
          "type": "string",
          "description": "The VAST specification version, parsed from the <code>version</code> attribute of the <code>VAST</code> tag in the response.",
          "examples": [
            "3.0"
          ],
          "pattern": "^(.*)$"
        },
        "vastAds": {
          "$id": "#/properties/vastResponse/vastAds",
          "type": "array",
          "description": "The ads parsed from the VAST response.",
          "items": {
            "$ref": "#/definitions/vastAd"
          }
        },
        "errors": {
          "$id": "#/properties/vastResponse/errors",
          "type": "array",
          "description": "The error URLs parsed from the <code>Error</code> tags in the VAST response.",
          "items": {
            "type": "string",
            "description": "A single error URL."
          }
        },
        "nonLinearAdsList": {
          "$id": "#/properties/vastResponse/nonLinearAds",
          "type": "array",
          "description": "A list of NonLinearAds as they are read from the VAST response.",
          "items": {
            "$ref": "#/definitions/nonLinearAds"
          }
        }
      }
    },

    "vastAd": {
      "$ref": "#/definitions/vastAd"
    },

    "vodVastResponseTimeOffset": {
      "$id": "#/properties/vodVastResponseTimeOffset",
      "type": "number",
      "description": "The VMAP specific time offset for VOD ad insertion.",
      "examples": [
        5.0
      ]
    },

    "vodCreativeOffsets": {
      "$id": "#/properties/vodCreativeOffsets",
      "type": "object",
      "title": "vodCreativeOffsets",
      "description": "A map that indicates the time offsets in the manifest where MediaTailor will insert avails, based on the VMAP response.",
      "additionalProperties": {
        "type": "array",
        "$id": "#/properties/vodCreativeOffsets/entry",
        "description": "A mapping from a time offset in the manifest to a list of ads to insert at this time.",
        "items": {
          "type": "object",
          "$id": "#/properties/vodCreativeOffsets/entry/items",
          "title": "vodCreativeOffset",
          "description": "The list of ads to insert at the specified time offset.",
          "additionalProperties": false,
          "required": [
            "uri",
            "creativeUniqueId",
            "vastDuration",
            "transcodedAdDuration",
            "adContent",
            "trackingEvents"
          ],
          "properties": {
            "uri": { "$ref": "#/definitions/adMezzanineUri" },
            "creativeUniqueId": { "$ref": "#/definitions/creativeUniqueId" },
            "vastDuration": { "$ref": "#/definitions/vastDuration" },
            "transcodedAdDuration": { "$ref": "#/definitions/transcodedAdDuration" },
            "adContent": { "$ref": "#/definitions/adContent" },
            "trackingEvents": { "$ref": "#/definitions/trackingEvents" }
          }
        }
      }
    },

    "adsRequestUrl": {
      "$id": "#/properties/adsRequestUrl",
      "type": "string",
      "description": "The full URL of the ADS request made by MediaTailor."
    },
    "adMarkers": {
      "$id": "#/properties/adMarkers",
      "type": "string",
      "description": "Found Ad Marker in the Manifest."
    },
    "segmentationUpid": {
      "$id": "#/properties/segmentationUpid",
      "type": "string",
      "description": "Value of segmentation upid parsed from ad markers in manifest."
    },
    "segmentationTypeId": {
      "$id": "#/properties/segmentationTypeId",
      "type": "integer",
      "description": "Value of segmentation typeId parsed from ad markers in manifest."
    },
    "requestHeaders": {
      "$id": "#/properties/requestHeaders",
      "type": "array",
      "description": "The headers that MediaTailor included with the ADS request. Typically, the logs include these when a request to the ADS fails, to help with troubleshooting.",
      "items": {
        "type": "object",
        "title": "requestheaders",
        "description": "The name and value for a single header included in the ADS request.",
        "required": [
          "name",
          "value"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the header."
          },
          "value": {
            "type": "string",
            "description": "The value of the header."
          }
        }
      }
    },

    "originalTargetUrl": {
      "$id": "#/properties/originalTargetUrl",
      "type": "string",
      "description": "The old URL to which MediaTailor was going to make a request."
    },
    "prefetchScheduleName": {
      "$id": "#/properties/prefetchScheduleName",
      "type": "string",
      "description": "The name of the prefetch schedule associated with this ad event.",
      "examples": [
        "PrefetchScheduleName"
      ],
      "pattern": "^(.*)$"
    },
    "updatedTargetUrl": {
      "$id": "#/properties/updatedTargetUrl",
      "type": "string",
      "description": "The new URL to which MediaTailor is making a request."
    },

    "rawAdsResponse": {
      "$id": "#/properties/rawAdsResponse",
      "type": "string",
      "description": "Paginated ADS response as it's exactly returned to MediaTailor."
    },
    "rawAdsResponseIndex": {
      "$id": "#/properties/rawAdsResponseIndex",
      "type": "integer",
      "description": "Integer value denoting this rawAdsResponse's index into the full ADS response. This value is used to order the paginated messages for this ADS response."
    }
  },

  "__COMMENT_oneOf": "The oneOf section defines subtypes for our events. Subtypes can have different rules, including which fields are required. For more information, see https://json-schema.org/understanding-json-schema/reference/combining.html#oneof ",

  "oneOf": [
    { "$ref": "#/definitions/eventAdMarkersFound" },
    { "$ref": "#/definitions/eventNonAdMarkerFound" },
    { "$ref": "#/definitions/eventMakingAdsRequest" },
    { "$ref": "#/definitions/eventModifiedTargetUrl" },
    { "$ref": "#/definitions/eventRawAdsResponse" },
    { "$ref": "#/definitions/eventVastResponse" },
    { "$ref": "#/definitions/eventFilledAvail" },
    { "$ref": "#/definitions/eventFilledOverlayAvail" },
    { "$ref": "#/definitions/eventErrorFiringBeaconFailed" },
    { "$ref": "#/definitions/eventWarningNoAdvertisements" },
    { "$ref": "#/definitions/eventUnknownHost" },
    { "$ref": "#/definitions/eventErrorAdsTimeout" },
    { "$ref": "#/definitions/eventErrorVastMissingOverlays" },
    { "$ref": "#/definitions/eventPlannedAvail" },
    { "$ref": "#/definitions/eventEmptyVastResponse" },
    { "$ref": "#/definitions/eventEmptyVmapResponse" },
    { "$ref": "#/definitions/eventErrorUnknown" },
    { "$ref": "#/definitions/eventVastRedirect" },
    { "$ref": "#/definitions/eventRedirectedVastResponse" },
    { "$ref": "#/definitions/eventErrorAdsMissingImpression" },
    { "$ref": "#/definitions/eventErrorAdsResponseParse" },
    { "$ref": "#/definitions/eventErrorAdsInvalidResponse" },
    { "$ref": "#/definitions/eventErrorDisallowedHost"},
    { "$ref": "#/definitions/eventPersonalizationDisabled"},
    { "$ref": "#/definitions/eventWarningDynamicVariableSubFailed"},
    { "$ref": "#/definitions/eventVodTimeBasedAvailPlanVastResponseForOffset" },
    { "$ref": "#/definitions/eventVodTimeBasedAvailPlanSuccess" }
  ],

  "definitions": {
    "eventAdMarkersFound": {
      "$id": "#/definitions/eventAdMarkersFound",
      "required": [
        "eventType",
        "adMarkers"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "AD_MARKER_FOUND"
        }
      }
    },
    "eventNonAdMarkerFound": {
      "$id": "#/definitions/eventNonAdMarkerFound",
      "required": [
        "eventType",
        "adMarkers"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "NON_AD_MARKER_FOUND"
        }
      }
    },
    "eventMakingAdsRequest": {
      "$id": "#/definitions/eventMakingAdsRequest",
      "required": [
        "eventType",
        "adsRequestUrl"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "MAKING_ADS_REQUEST"
        }
      }
    },

    "eventModifiedTargetUrl": {
      "$id": "#/definitions/eventModifiedTargetUrl",
      "required": [
        "eventType",
        "originalTargetUrl",
        "updatedTargetUrl"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "MODIFIED_TARGET_URL"
        }
      }
    },

    "eventRawAdsResponse": {
      "$id": "#/definitions/eventRawAdsResponse",
      "required": [
        "eventType",
        "rawAdsResponse",
        "rawAdsResponseIndex"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "RAW_ADS_RESPONSE"
        }
      }
    },

    "eventVastResponse": {
      "$id": "#/definitions/eventVastResponse",
      "_comment": "NOTE: the vastResponse property should ideally be marked as a required field for this event, but unfortunately, in the case of an empty vast response, we currently emit an EMPTY_VAST_RESPONSE followed by a VAST_RESPONSE, and the vastResponse property is not present in the latter. We need to fix this so that we don't emit both of those events in the empty response case, and update this schema to flag vastResponse as required for VAST_RESPONSE.",
      "required": [
        "eventType"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "VAST_RESPONSE"
        }
      }
    },

    "eventFilledAvail": {
      "$id": "#/definitions/eventFilledAvail",
      "required": [
        "eventType",
        "avail"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "FILLED_AVAIL"
        }
      }
    },

    "eventFilledOverlayAvail": {
      "$id": "#/definitions/eventFilledOverlayAvail",
      "required": [
        "eventType",
        "avail"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "FILLED_OVERLAY_AVAIL"
        }
      }
    },

    "eventErrorVastMissingOverlays": {
      "$id": "#/definitions/eventErrorVastMissingOverlays",
      "required": [
        "eventType",
        "adsRequestUrl",
        "requestHeaders"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "ERROR_VAST_MISSING_OVERLAYS"
        }
      }
    },

    "eventErrorFiringBeaconFailed": {
      "$id": "#/definitions/eventErrorFiringBeaconFailed",
      "required": [
        "eventType",
        "error",
        "beaconInfo"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "ERROR_FIRING_BEACON_FAILED"
        }
      }
    },

    "eventWarningNoAdvertisements": {
      "$id": "#/definitions/eventWarningNoAdvertisements",
      "required": [
        "eventType"
      ],
      "_comment": "We should really have a more descriptive error field for these events",
      "properties": {
        "eventType": {
          "type": "string",
          "const": "WARNING_NO_ADVERTISEMENTS"
        }
      }
    },

    "eventUnknownHost": {
      "$id": "#/definitions/eventUnknownHost",
      "required": [
        "eventType",
        "requestHeaders"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "ERROR_UNKNOWN_HOST"
        }
      }
    },

    "eventErrorAdsTimeout": {
      "$id": "#/definitions/eventErrorAdsTimeout",
      "required": [
        "eventType",
        "adsRequestUrl",
        "requestHeaders"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "ERROR_ADS_TIMEOUT"
        }
      }
    },

    "eventPlannedAvail": {
      "$id": "#/definitions/eventPlannedAvail",
      "required": [
        "eventType"
      ],
      "_comment": "TODO: Flesh this out as we implement it",
      "properties": {
        "eventType": {
          "type": "string",
          "const": "PLANNED_AVAIL"
        }
      }
    },

    "eventEmptyVastResponse": {
      "$id": "#/definitions/eventEmptyVastResponse",
      "required": [
        "eventType"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "EMPTY_VAST_RESPONSE"
        }
      }
    },

    "eventEmptyVmapResponse": {
      "$id": "#/definitions/eventEmptyVmapResponse",
      "required": [
        "eventType"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "EMPTY_VMAP_RESPONSE"
        }
      }
    },

    "eventErrorUnknown": {
      "$id": "#/definitions/eventErrorUnknown",
      "required": [
        "eventType"
      ],
      "_comment": "TODO: we should have a field for the exception message or something",
      "properties": {
        "eventType": {
          "type": "string",
          "const": "ERROR_UNKNOWN"
        }
      }
    },

    "eventVastRedirect": {
      "$id": "#/definitions/eventVastRedirect",
      "required": [
        "eventType"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "VAST_REDIRECT"
        }
      }
    },

    "eventRedirectedVastResponse": {
      "$id": "#/definitions/eventRedirectedVastResponse",
      "required": [
        "eventType"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "REDIRECTED_VAST_RESPONSE"
        }
      },
      "_comment": "NOTE that the property vastResponse is not required because empty vast responses do not contain a vastResponse."
    },

    "eventErrorAdsResponseParse": {
      "$id": "#/definitions/eventErrorAdsResponseParse",
      "required": [
        "eventType"
      ],
      "_comment": "We should have a field with an error message here",
      "properties": {
        "eventType": {
          "type": "string",
          "const": "ERROR_ADS_RESPONSE_PARSE"
        }
      }
    },

    "eventErrorAdsInvalidResponse": {
      "$id": "#/definitions/eventErrorAdsInvalidResponse",
      "required": [
        "eventType",
        "additionalInfo"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "ERROR_ADS_INVALID_RESPONSE"
        }
      }
    },

    "eventErrorAdsMissingImpression": {
      "$id": "#/definitions/eventErrorAdsMissingImpression",
      "required": [
        "eventType"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "ERROR_VAST_MISSING_IMPRESSION"
        }
      }
    },

    "eventErrorDisallowedHost": {
      "$id": "#/definitions/eventErrorDisallowedHost",
      "required": [
        "eventType"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "ERROR_DISALLOWED_HOST"
        }
      }
    },

    "eventPersonalizationDisabled": {
      "$id": "#/definitions/eventPersonalizationDisabled",
      "required": [
        "eventType"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "ERROR_PERSONALIZATION_DISABLED"
        }
      }
    },

    "eventWarningDynamicVariableSubFailed": {
      "$id": "#/definitions/eventWarningDynamicVariableSubFailed",
      "required": [
        "eventType",
        "adsRequestUrl"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "WARNING_URL_VARIABLE_SUBSTITUTION_FAILED"
        }
      }
    },

    "eventVodTimeBasedAvailPlanVastResponseForOffset": {
      "$id": "#/definitions/eventVodTimeBasedAvailPlanVastResponseForOffset",
      "required": [
        "eventType",
        "vastResponse"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "VOD_TIME_BASED_AVAIL_PLAN_VAST_RESPONSE_FOR_OFFSET"
        }
      }
    },

    "eventVodTimeBasedAvailPlanSuccess": {
      "$id": "#/definitions/eventVodTimeBasedAvailPlanSuccess",
      "required": [
        "eventType",
        "vodCreativeOffsets"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "VOD_TIME_BASED_AVAIL_PLAN_SUCCESS"
        }
      }
    },

    "creativeUniqueId": {
      "type": "string",
      "description": "The unique identifier for the ad, used as a key for transcoding. This is the ID field for the creative in the VAST response, if available. Otherwise, it's the mezzanine URL of the ad. "
    },

    "adSystem": {
      "type": "string",
      "description": "The value of the <code>AdSystem</code> tag in the VAST response. "
    },

    "vastDuration": {
      "type": "number",
      "description": "The duration of the ad, as parsed from the VAST response."
    },

    "transcodedAdDuration": {
      "type": "number",
      "description": "The duration of the ad, calculated from the transcoded asset."
    },

    "adContent": {
      "$id": "#/properties/adContent",
      "type": ["object", "null"],
      "title": "adContent",
      "description": "Information about the content of the inserted ad.",
      "additionalProperties": false,
      "properties": {
        "adPlaylistUris": {
          "$id": "#/properties/adContent/adPlaylistUris",
          "type": "object",
          "title": "adPlaylistUris",
          "description": "The mapping from the origin manifest for a variant to the ad manifest for the variant. For DASH, this contains a single entry, because all variants are represented in a single DASH manifest. ",
          "additionalProperties": {
            "$id": "#/properties/adContent/adPlaylistUris/adPlaylistUri",
            "type": "string",
            "description": "The URL of the ad manifest for the specific variant."
          }
        }
      }
    },

    "adMezzanineUri": {
      "type": "string",
      "description": "The URL of the mezzanine version of the ad, which is the input to the transcoder."
    },

    "bitrate": {
      "type": "integer",
      "examples": [
        533
      ],
      "description": "The bitrate."
    },
    "width": {
      "type": "integer",
      "examples": [
        1280
      ],
      "description": "Width in pixels."
    },
    "height": {
      "type": "integer",
      "examples": [
        720
      ],
      "description": "Height in pixels."
    },

    "trackingEvents": {
      "type": "object",
      "title": "trackingEvents",
      "description": "The tracking beacon URLs for the various tracking events for the ad. The keys are the event names, and the values are a list of beacon URLs.",

      "additionalProperties":  {
        "type": "array",
        "description": "The list of beacon URLs for the specified tracking event (impression, complete, and so on)",
        "items": {
          "type": "string",
          "description": "The beacon URLs for this tracking event."
        }
      }
    },

    "nonLinearAds": {
      "$id": "#/properties/nonLinearAds",
      "type": "object",
      "title": "nonLinearAds",
      "description": "A NonLinearAds as it appears in the VAST response.",
      "required": [
        "nonLinearAdList",
        "nonLinearTrackingEvents"
      ],
      "properties": {
        "nonLinearAdList": {
          "type": "array",
          "description": "List of non linear ads as they exist within one NonLinearAds.",
          "items": {
            "type": "object",
            "title": "nonLinearAdList",
            "description": "List of NonLinearAd as they are parsed from its parent NonLinearAds.",
            "properties": {
              "nonLinearAdId": {
                "type": "string",
                "description": "Ad ID of this non linear ad."
              },
              "nonLinearAdSystem": {
                "type": "string",
                "description": "Ad system of this non linear ad's parent Inline ad."
              },
              "nonLinearAdTitle": {
                "type": "string",
                "description": "Ad title of this non linear ad's parent Inline ad."
              },
              "nonLinearCreativeId": {
                "type": "string",
                "description": "Creative ID of this non linear ad's parent Creative ad."
              },
              "nonLinearCreativeAdId": {
                "type": "string",
                "description": "Creative ad ID of this non linear ad."
              },
              "nonLinearCreativeSequence": {
                "type": "string",
                "description": "Creative sequence of this non linear ad."
              },
              "nonLinearWidth": {
                "type": "string",
                "description": "Width of this non linear ad."
              },
              "nonLinearHeight": {
                "type": "string",
                "description": "Height of this non linear ad."
              },
              "nonLinearExpandedWidth": {
                "type": "string",
                "description": "Expanded width of this non linear ad."
              },
              "nonLinearExpandedHeight": {
                "type": "string",
                "description": "Expanded height of this non linear ad."
              },
              "nonLinearScalable": {
                "type": "boolean",
                "description": "Boolean denoting if this non linear ad is scalable."
              },
              "nonLinearMaintainAspectRatio": {
                "type": "boolean",
                "description": "Boolean denoting if aspect ratio should be maintained for this non linear ad."
              },
              "nonLinearMinSuggestedDuration": {
                "type": "string",
                "description": "Min suggested duration for this non linear ad."
              },
              "nonLinearApiFramework": {
                "type": "string",
                "description": "API framework for this non linear ad's parent Inline ad."
              },
              "nonLinearStaticResource": {
                "type": "string",
                "description": "Static resource for this non linear ad."
              },
              "nonLinearStaticResourceCreativeType": {
                "type": "string",
                "description": "Static Resource creative type for this non linear ad."
              },
              "nonLinearIFrameResource": {
                "type": "string",
                "description": "I-Frame resource for this non linear ad."
              },
              "nonLinearHtmlResource": {
                "type": "string",
                "description": "HTML resource for this non linear ad."
              },
              "nonLinearAdParameters": {
                "type": "string",
                "description": "Ad parameters for this non linear ad."
              },
              "nonLinearClickThrough": {
                "type": "string",
                "description": "Click Through data for this non linear ad."
              },
              "nonLinearClickTracking": {
                "type": "string",
                "description": "Click Tracking data for this non linear ad."
              },
              "nonLinearClickTrackingId": {
                "type": "string",
                "description": "Click Tracking ID for this non linear ad."
              }
            }
          }
        },
        "nonLinearTrackingEvents": { "$ref": "#/definitions/trackingEvents" },
        "extensions": {
          "$id": "#/properties/nonLinearAds/extensions",
          "type": "array",
          "description": "Extensions that exist for this NonLinearAds.",
          "items": {
            "$id": "#/properties/nonLinearAds/extensions/items",
            "type": "object",
            "title": "Extensions",
            "description": "Extensions found in non linear ads",
            "additionalProperties":  false,
            "properties": {
              "extensionType": {
                "$id": "#/properties/nonLinearAds/extensions/extensionType",
                "type": "string",
                "description": "The value of the extension type attribute of the <code>Extensions</code> tag.",
                "examples": [
                  "FreeWheel"
                ]
              },
              "extensionContent": {
                "$id": "#/properties/nonLinearAds/extensions/extensionContent",
                "type": "string",
                "description": "The extension content attribute of the <code>Extensions</code> tag.",
                "examples": [
                  "progressive"
                ]
              }
            }
          }
        }
      }
    },
    "adBreakTrackingEvents": {
      "$id": "#/properites/adBreakTrackingEvents",
      "type": "object",
      "title": "adBreakTrackingEvents",
      "description": "These are all VMAP ad break tracking events.",
      "additionalProperties": {
        "type": "array",
        "description": "VMAP/ad break tracking events and corresponding URL",
        "items": {
          "type": "string",
          "description": "The beacon URLs for this tracking event."
        }
      }
    },
    "vastAd": {
      "$id": "#/properties/vastAd",
      "type": "object",
      "title": "vastAd",
      "description": "Information about a single ad parsed from the VAST response.",
      "required": [
        "vastAdId",
        "adSystem",
        "adTitle",
        "creativeId",
        "creativeAdId",
        "duration",
        "vastMediaFiles",
        "trackingEvents"
      ],
      "additionalProperties":  false,
      "properties": {
        "vastAdId": {
          "$id": "#/properties/vastAd/vastAdId",
          "type": "string",
          "description": "The value of the id attribute of the <code>Ad</code> tag in the VAST response",
          "examples": [
            "ad1"
          ]
        },
        "adSystem": {"$ref": "#/definitions/adSystem" } ,
        "adTitle": {
          "$id": "#/properties/vastAd/adTitle",
          "type": "string",
          "description": "The media files that are available for the ad in the VAST response.",
          "examples": [
            "External NCA1C1L1 LinearInlineSkippable"
          ]
        },
        "creativeId": {
          "$id": "#/properties/vastAd/creativeId",
          "type": "string",
          "description": "The value of the id attribute of the <code>Creative</code> tag in the VAST response.",
          "examples": [
            "creative1"
          ]
        },
        "creativeAdId": {
          "$id": "#/properties/vastAd/creativeAdId",
          "type": "string",
          "description": "The value of the adId attribute of the <code>Creative</code> tag in the VAST response."
        },
        "duration": {
          "$id": "#/properties/vastAd/duration",
          "type": "number",
          "description": "The approximate duration of the ad, based on the <code>duration</code> tag in the <code>linear</code> element of the VAST response.",
          "examples": [
            30,
            30.0
          ]
        },
        "vastMediaFiles": {
          "$id": "#/properties/vastAd/vastMediaFiles",
          "type": "array",
          "description": "The list of available media files for the ad in the VAST response.",
          "items": {
            "$id": "#/properties/vastAd/vastMediaFiles/items",
            "type": "object",
            "title": "vastMediaFile",
            "description": "Information about a media file for the ad.",
            "required": [
              "uri",
              "id",
              "delivery",
              "type",
              "apiFramework",
              "width",
              "height",
              "bitrate"
            ],
            "additionalProperties":  false,
            "properties": {
              "uri": { "$ref": "#/definitions/adMezzanineUri" },
              "id": {
                "$id": "#/properties/vastAd/vastMediaFiles/items/properties/id",
                "type": "string",
                "description": "The value of the id attribute of the <code>MediaFile</code> tag.",
                "examples": [
                  "GDFP"
                ]
              },
              "delivery": {
                "$id": "#/properties/vastAd/vastMediaFiles/items/properties/delivery",
                "type": "string",
                "description": "The protocol used for the media file, set to either progressive or streaming.",
                "examples": [
                  "progressive"
                ]
              },
              "type": {
                "$id": "#/properties/vastAd/vastMediaFiles/items/properties/type",
                "type": "string",
                "description": "The MIME type of the media file, taken from the type attribute of the <code>MediaFile</code> tag.",
                "examples": [
                  "video/mp4"
                ]
              },
              "apiFramework": {
                "$id": "#/properties/vastAd/vastMediaFiles/items/properties/apiFramework",
                "type": "string",
                "description": "The API framework needed to manage the media file. Example: <code>VPAID</code>."
              },
              "width": {
                "$ref": "#/definitions/width"
              },
              "height": {
                "$ref": "#/definitions/height"
              },
              "bitrate": {
                "$ref": "#/definitions/bitrate"
              }
            }
          }
        },
        "trackingEvents": { "$ref": "#/definitions/trackingEvents" },
        "vastAdTagUri": {
          "$id": "#/properties/vastAd/vastAdTagUri",
          "type": "string",
          "description": "The VMAP-specific redirect URI for an ad.",
          "examples": [
            "https://ads.redirect.com/redirect1"
          ]
        }
      }
    }
  }
}
```

# AWS Elemental MediaTailor マニフェストログの説明とイベントタイプ
<a name="log-types"></a>

以下のセクションでは、MediaTailor がマニフェストのリクエストと受信時にオリジンサーバーとのイベントを記述するために出力するログについて説明します。これらは`ManifestService`ログです。

**Topics**
+ [ManifestService のイベント](#log-types-origininteraction)
+ [マニフェストログのプロパティ](#manifest-logs-main)

## ManifestService のイベント
<a name="log-types-origininteraction"></a>

次のイベントは、MediaTailor とオリジンとのやり取り中に出力されます。


| Log | 説明 | 
| --- | --- | 
| CONFIG\$1SECURITY\$1ERROR | MediaTailor 設定にセキュリティ上の問題があります。 | 
| CONFIG\$1SYNTAX\$1ERROR | オリジンパスとアセットパスの URL の形式が正しくありません。 | 
| CONNECTION\$1ERROR | オリジンへの MediaTailor 接続が拒否または失敗しました。 | 
| GENERATED\$1MANIFEST | MediaTailor がマニフェストを生成しました。これらのログを受信するには、デバッグモードが有効になっている必要があります。デバッグログモードを有効にする方法などの詳細については、「」を参照してください[デバッグログの生成](debug-log-mode.md)。 | 
| HOST\$1DISALLOWED | MediaTailor は、このホストへの HTTP リクエストを許可しません。 | 
| INCOMPATIBLE\$1HLS\$1VERSION | マニフェストは互換性のない HLS バージョンを使用します。MediaTailor にはバージョン 3 以降が必要です。 | 
| INVALID\$1SINGLE\$1PERIOD\$1DASH\$1MANIFEST | 単一期間 DASH マニフェストが無効です。MediaTailor は単一期間 DASH マニフェストを通過しています。 | 
| IO\$1ERROR | MediaTailor がオリジンとの通信中に IO エラーが発生しました。 | 
| LAST\$1PERIOD\$1MISSING\$1AUDIO | DASH マニフェストの最後の期間は、オリジンオーディオまたはビデオのずれAdaptationSetsのため、すべてのオーディオがありません。再生の問題を回避するには、少なくとも次のリクエストまで最後の期間の公開を遅らせます。 | 
| LAST\$1PERIOD\$1MISSING\$1AUDIO\$1WARNING | DASH マニフェストの最後の期間は、オリジンオーディオまたはビデオのずれAdaptationSetsのため、すべてのオーディオがありません。最後の期間を公開する (遅延しない) ことを選択します。オーディオがないと、再生の問題が発生する可能性があります。 | 
| MANIFEST\$1ERROR | MediaTailor マニフェストリクエストに失敗しました。 | 
| NO\$1MASTER\$1OR\$1MEDIA\$1PLAYLIST | オリジンレスポンスには、プライマリプレイリストまたはメディアプレイリストは含まれません。 | 
| NO\$1MASTER\$1PLAYLIST | オリジンレスポンスに、予想されるプライマリプレイリストが含まれていません。 | 
| NO\$1MEDIA\$1PLAYLIST | オリジンレスポンスに、予想されるメディアプレイリストが含まれていません。 | 
| ORIGIN\$1MANIFEST | MediaTailor がオリジンマニフェストを取得しました。これらのログを受信するには、デバッグモードが有効になっている必要があります。デバッグログモードを有効にする方法などの詳細については、「」を参照してください[デバッグログの生成](debug-log-mode.md)。 | 
| PARSING\$1ERROR | オリジンはマニフェストリクエストを解析できません。 | 
| SCTE35\$1PARSING\$1ERROR | MediaTailor はマニフェスト内のSignal Binary要素を解析できません。 | 
| SESSION\$1INITIALIZED | セッションが初期化されました。これらのログを受信するには、デバッグモードが有効になっている必要があります。デバッグログモードを有効にする方法などの詳細については、「」を参照してください[デバッグログの生成](debug-log-mode.md)。 | 
| TIMEOUT\$1ERROR | MediaTailor マニフェストリクエストがタイムアウトしました。 | 
| TRACKING\$1RESPONSE | MediaTailor は追跡レスポンスを提供しました。これらのログを受信するには、デバッグモードが有効になっている必要があります。デバッグログモードを有効にする方法などの詳細については、「」を参照してください[デバッグログの生成](debug-log-mode.md)。 | 
| UNKNOWN\$1ERROR | MediaTailor で不明なエラーが発生しました。 | 
| UNKNOWN\$1HOST | ホストが不明です。 | 
| UNSUPPORTED\$1SINGLE\$1PERIOD\$1DASH\$1MANIFEST | 単一期間 DASH マニフェストはサポートされていません。MediaTailor は単一期間 DASH マニフェストを通過しています。 | 

## マニフェストログのプロパティ
<a name="manifest-logs-main"></a>

このセクションでは、マニフェストログのプロパティについて説明します。


| プロパティ | タイプ | 必須 | 
| --- | --- | --- | 
| awsAccountId | string | true | 
| eventTimestamp | string | true | 
| originId | string | true | 
| customerId | string | false | 
| eventType | string | false | 
| sessionId | string | false | 
| originRequestUrl | string | false | 
| mediaTailorPath | string | false | 
| requestId | string | false | 
| responseBody | string | false | 
| sessionType | string (有効な値: [DASH, HLS]) | false | 
| requestNextToken | string | false | 
| eventDescription | string | false | 
| assetPath | string | false | 
| originFullUrl | string | false | 
| originPrefixUrl | string | false | 
| additionalInfo | string | false | 
| cause | string | false | 
| response | string | false | 
| httpCode | string | false | 
| errorMessage | string | false | 
| adAdsResponse | string | false | 
| adAdsRawResponse | string | false | 
| adAdsRequest | string | false | 
| adNumNewAvails | string | false | 
| generatedMediaPlaylist | string | false | 
| requestStartTime | string | false | 
| requestEndTime | string | false | 
| requestStartTimeEpochMillis | string | false | 
| requestEndTimeEpochMillis | string | false | 

# AWS Elemental MediaTailor トランスコードログの説明とイベントタイプ
<a name="tm-log-format"></a>

以下のセクションでは、広告ステッチング用のクリエイティブを準備する際にMediaTailor がトランスコードサービスでイベントを記述するために出力するログについて説明します。これらは`TranscodeService`ログです。

**Topics**
+ [TranscodeService のイベント](#log-types-tminteraction)
+ [トランスコードログのプロパティ](#transcode-logs-main)

## TranscodeService のイベント
<a name="log-types-tminteraction"></a>

以下のイベントは、広告のトランスコード中に MediaTailor とのやり取り中に出力されます。


| Log | 説明 | 
| --- | --- | 
| IMPORT\$1ERROR | MediaTailor はインポートジョブ中に内部エラーが発生しました (前提条件付き広告の場合）。空の広告セットを使用する。 | 
| INITIALIZED | MediaTailor は、トランスコードジョブまたはインポートジョブ (前提条件付き広告の場合) のいずれかを初期化しました。 | 
| INTERNAL\$1ERROR | MediaTailor で内部エラーが発生しました。空の広告セットを使用する。 | 
| MISSING\$1VARIANTS | バリアントがないため、MediaTailor は広告をトランスコードできませんでした。空の広告セットを使用する。 | 
| PROFILE\$1NOT\$1FOUND | トランスコードするプロファイルがないため、MediaTailor は広告をトランスコードできませんでした。空の広告セットを使用する。 | 
| TRANSCODE\$1COMPLETED | 動画のトランスコードが完了しました。広告は広告挿入に使用できます。 | 
| TRANSCODE\$1ERROR | MediaTailor でトランスコードジョブ中に内部エラーが発生しました。空の広告セットを使用する。 | 
| TRANSCODE\$1IN\$1PROGRESS | ビデオトランスコードが進行中です。トランスコードされたビデオは準備ができていません。空の広告セットを使用する。 | 

## トランスコードログのプロパティ
<a name="transcode-logs-main"></a>

このセクションでは、トランスコードログのプロパティについて説明します。


| プロパティ | タイプ | 必須 | 説明 | 
| --- | --- | --- | --- | 
| awsAccountId | string | true | セッションに使用された MediaTailor 設定の AWS アカウント ID。 | 
| eventTimestamp | string | true | リクエストの日付と時刻。 | 
| originId | string | true | MediaTailor 設定からの設定名。これは、同じく設定の一部である動画コンテンツソースとは異なります。 | 
| eventType | string | false | このログメッセージをトリガーしたイベントのコード。例えば、TRANSCODE\$1ERROR などです。 | 
| eventDescription | string | false | MediaTailor サービスによって提供される、このログメッセージをトリガーしたイベントの簡単な説明。デフォルトでは、これは空です。 | 
| sessionId | string | false | MediaTailor がプレイヤーセッションに割り当てた一意の数値識別子。プレイヤーがセッションに対して行うすべてのリクエストは、同じセッション ID を持ちます。例えば、e039fd39-09f0-46b2-aca9-9871cc116cde などです。 | 
| creativeUniqueId | string | false | トランスコードされている広告クリエイティブの一意の識別子。 | 
| profileName | string | false |  | 
| adUri | string | false | 広告クリエイティブの URI。 | 
| transcodeRequestId | string | false | このトランスコードリクエストの一意の識別子。 | 
| cacheStatus | string | false | MediaTailor がトランスコードされた広告をキャッシュしたかどうかを示します。 | 

# 提供されたログを使用して AWS Elemental MediaTailor ログを送信する
<a name="vended-logs"></a>

提供されたログを使用して柔軟性を高め、MediaTailor が再生設定から出力するログを配信する場所を制御できます。

提供されたログでは、MediaTailor は設定に関連付けられたすべてのログアクティビティを Amazon CloudWatch Logs に送信します。その後、CloudWatch Logs は、指定したログの割合を選択した送信先に送信します。サポートされている送信先は、Amazon CloudWatch Logs ロググループ、Amazon S3 バケット、または Amazon Data Firehose ストリームです。

販売されたログはボリューム割引料金で利用できるため、CloudWatch Logs に直接ログを送信するよりもコストを節約できます。料金については、*「Amazon CloudWatch 料金表」の「ログ」タブの「Vended* **Logs**」を参照してください。 [Amazon CloudWatch ](https://aws.amazon.com/cloudwatch/pricing/)

販売ログを使用するには、以下を実行する必要があります。

1. [アクセス許可を追加する](#vended-logs-perms).

1. [ログ配信先を作成する](#vended-logs-destinations).

1. [CloudWatch Logs でログ配信を設定する](#vended-logs-delivery).

1. [MediaTailor で販売ログを有効にする](#vended-logs-config).

提供されたログの詳細については、CloudWatch Logs [ユーザーガイド」の AWS 「サービスからのログ記録](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html)を有効にする」を参照してください。MediaTailor は、提供されたログの V2 をサポートしています。

## ステップ 1: MediaTailor ログ配信のアクセス許可を追加する
<a name="vended-logs-perms"></a>

販売ログを設定するユーザーには、MediaTailor で配信先を作成し、ログ配信を設定し、販売ログを有効にするためのアクセス許可が必要です。次のポリシーを使用して、提供されたログをセットアップするための適切なアクセス許可があることを確認します。

**CloudWatch Logs と配信先のポリシー**  
*Amazon CloudWatch Logs ユーザーガイド*の以下のセクションでは、CloudWatch Logs と配信先でログを操作できるようにするポリシーについて説明します。複数の場所にログを送信する場合は、複数のポリシーを作成する代わりに、ポリシーステートメントを 1 つのポリシーに結合できます。  
+ [CloudWatch Logs に送信されたログ](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-logs-infrastructure-V2-CloudWatchLogs)
+ [Amazon S3 に送信されたログ](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-logs-infrastructure-V2-S3)
+ [Firehose に送信されたログ](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-logs-infrastructure-V2-Firehose)

**コンソールからセットアップするためのポリシー**  
API または ではなく コンソールを使用して、販売ログの配信を設定する場合は AWS CLI、ポリシーに次の追加のアクセス許可が必要です。

**MediaTailor で提供されたログのポリシー**  
MediaTailor で販売されたログ配信を作成、表示、または変更するには、ポリシーに次のアクセス許可が必要です。

アクセス許可の追加とポリシーの操作については、「」を参照してください[の Identity and Access Management AWS Elemental MediaTailor](security-iam.md)。

## ステップ 2: MediaTailor ログの配信先を作成する
<a name="vended-logs-destinations"></a>

ログが送信されるリソースを作成します。後のステップでログ配信の設定に使用するリソースの ARN を記録します。

**CloudWatch Logs ロググループの配信先**  
ロググループの作成には、次のいずれかを使用します。  
+ コンソールについては、「Amazon [ CloudWatch Logs ユーザーガイド」の「CloudWatch Logs でロググループを作成する](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#Create-Log-Group)*Amazon CloudWatch*」を参照してください。
+ API については、「Amazon CloudWatch Logs API リファレンス」の「[CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html)」を参照してください。 *Amazon CloudWatch * 
+ SDKs「Amazon CloudWatch Logs [ユーザーガイド」の AWS 「 SDK `CreateLogGroup`で使用する」または AWS CLI](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/example_cloudwatch-logs_CreateLogGroup_section.html)「」を参照してください。 *Amazon CloudWatch * 

**Amazon S3 バケット配信先**  
バケットの作成には、次のいずれかを使用します。  
+ コンソール、SDKs*「Amazon Simple Storage Service ユーザーガイド*」の[「バケットの作成](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html)」を参照してください。
+ API については、*Amazon Simple Storage Service API リファレンス*の[CreateBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html)」を参照してください。

**Firehose ストリーム配信先**  
ストリームの作成については、*Amazon Data* [Firehose デベロッパーガイドの「コンソールから Firehose ストリームを作成する](https://docs.aws.amazon.com/firehose/latest/dev/basic-create.html)」を参照してください。

## ステップ 3: MediaTailor 再生設定で提供されたログを有効にする
<a name="vended-logs-config"></a>

前のステップで作成した配信先にログを送信する再生設定を作成または更新します。後のステップでログ配信の設定に使用する設定の名前を記録します。
+ コンソールで、 [設定の作成](configurations-create.md)または 設定[設定の編集](configurations-edit.md)を編集して**ログ記録**設定にアクセスすることで、提供されたログを有効にするには。**ログ記録戦略**については、**「Vended logs**」を選択します。
+ API を通じて販売ログを有効にするには、既存の設定が必要です。`ConfigureLogsForPlaybackConfiguration` を使用してログ記録戦略 を追加します`Vended logs`。

CloudWatch Logs に直接ログを送信するレガシー MediaTailor ログ記録戦略を使用していて、提供されたログに移行する場合は、「」を参照してください[ログ記録戦略の移行](vended-logs-migrate.md)。

**重要**  
 ログ戦略をレガシー CloudWatch から販売済みログに変更した場合、MediaTailor は更新を保存するとすぐにこの変更を行います。販売者のログ記録が完全に設定されるまで、ログの受信は停止します。

## ステップ 4: CloudWatch Logs でログ配信を設定する
<a name="vended-logs-delivery"></a>

CloudWatch Logs では、ログ配信の一部を表す 3 つの要素を作成する必要があります。これらの要素は、*Amazon CloudWatch Logs API リファレンス*の [CreateDelivery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html) で詳しく説明されています。CloudWatch Logs API を使用して配信を設定する大まかな手順は次のとおりです。

**CloudWatch Logs でログ配信を設定するには (API)**

1. [https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html) を使用してログのソースを追加します。

   は、ログを生成している再生設定`DeliverySource`を表します。を作成するには、再生設定の名前が必要です`DeliverySource`。

1. を使用して[https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html)、ログが書き込まれる送信先を追加します。

   は配信先`DeliveryDestination`を表します。を作成するには、ロググループ、バケット、またはストリームの ARN が必要です`DeliveryDestination`。

1. アカウント間でログを配信[https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html)する場合は、 を使用します。

   配信先が再生設定とは異なるアカウントにある場合は、 が必要です`DeliveryDestinationPolicy`。このポリシーにより、CloudWatch Logs は にログを配信できます`DeliveryDestination`。

1. [https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html) を使用して `DeliverySource`を にリンクします`DeliveryDestination`。

   は、 `DeliverySource`と の間の接続`Delivery`を表します`DeliveryDestination`。

# AWS Elemental MediaTailor ログ記録戦略の移行
<a name="vended-logs-migrate"></a>

 ログ戦略をレガシー CloudWatch から販売済みログに変更した場合、MediaTailor は更新を保存するとすぐにこの変更を行います。ログ記録ワークフローの中断を回避するには、次の手順を使用してログ記録戦略を移行します。

1. 「[販売ログの使用](vended-logs.md)」に説明されている手順に従います。では[MediaTailor で販売ログを有効にする](vended-logs.md#vended-logs-config)、*両方の*ログ記録戦略 (**提供されたログ**と**レガシー CloudWatch**) を選択します。

   MediaTailor は、提供されたログと CloudWatch Logs の両方を通じてログを直接送信します。

1. ロギング戦略と配信先に依存するワークフローに必要な変更を加えます。

1. **ログ記録戦略**から**レガシー CloudWatch** を再検討[MediaTailor で販売ログを有効にする](vended-logs.md#vended-logs-config)して削除します。

# Amazon CloudWatch Logs に直接 AWS Elemental MediaTailor ログを書き込む
<a name="monitoring-cw-logs"></a>

MediaTailor は、セッションアクティビティ、および広告決定サーバーとのやり取りに関する詳しい情報が含まれたログを生成し、それらを Amazon CloudWatch に書き込みます。ログは、セッション中に発生したアクティビティの順次的な説明を提供します。

MediaTailor は、提供されたログを使用して、ログ配信とボリューム割引の料金に柔軟性を持たせることもできます。提供されたログの詳細については、「」を参照してください[販売ログの使用](vended-logs.md)。

**Topics**
+ [Amazon CloudWatch Logs のアクセス許可](monitoring-permissions.md)
+ [AWS Elemental MediaTailor チャネルアセンブリの「As Run」ログ](as-run-log.md)
+ [AWS Elemental MediaTailor Amazon CloudWatch Logs Insights での ADS ログ分析](monitor-cloudwatch-ads-logs.md)

# Amazon CloudWatch Logs のアクセス許可
<a name="monitoring-permissions"></a>

 AWS Identity and Access Management (IAM) を使用して、Amazon CloudWatch AWS Elemental MediaTailor へのアクセスを許可するロールを作成します。アカウントに対して CloudWatch Logs を公開するには、これらのステップを実行する必要があります。CloudWatch は、お使いのアカウントに関するメトリクスを自動的に発行します。

**CloudWatch へのアクセスを MediaTailor に許可する**

1. IAM コンソール ([https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/)) を開きます。

1. IAM コンソールのナビゲーションペインで、**[Roles]** (ロール)、**[Create role]** (ロールを作成) の順に選択します。

1. **別の AWS アカウント**ロールタイプを選択します。

1. **アカウント ID** には、 AWS アカウント ID を入力します。

1. [**Require external ID (外部 ID を必須にする)**] を選択し、「**Midas**」と入力します。このオプションにより、リクエストに正しい `sts:ExternalId` が含まれている場合にのみサービスがロールを引き受けることができるという条件が、信頼ポリシーに自動的に追加されます。

1. **[Next: Permissions]** (次のステップ: 許可) を選択します。

1. このロールが実行できるアクションを指定するアクセス許可ポリシーを追加します。以下のいずれかのオプションを選択した後、[**Next: Review (次へ: 確認)**] を選択します。
   + Amazon CloudWatch Logs への完全なアクセス権を付与するための **CloudWatchLogsFullAccess**
   + Amazon CloudWatch への完全なアクセス権を付与するための **CloudWatchFullAccess**

1. [**ロール名**] に「**MediaTailorLogger**」と入力し、[**ロールの作成**] を選択します。

1. [**ロール**] ページで、作成したロールを選択します。

1. プリンシパルを更新するには、信頼関係を編集します。

   1. ロールの [**Summary (概要)**] ページで、[**Trust relationship (信頼関係)**] タブを選択します。

   1. [**Edit trust relationship (信頼関係の編集)**] を選択します。

   1. ポリシードキュメントで、プリンシパルを MediaTailor サービスに変更します。プリンシパルは以下のようになります。

      ```
      "Principal": {
         "Service": "mediatailor.amazonaws.com"
      },
      ```

      ポリシー全体は以下のようになります。

   1. **[Update Trust Policy]** (信頼ポリシーの更新) をクリックします。

# AWS Elemental MediaTailor チャネルアセンブリの「As Run」ログ
<a name="as-run-log"></a>

*実行ログ*は、CloudWatch `MediaTailor/Channel/AsRunLog`ロググループで、再生中のプログラムと広告ブレークに関する情報を表示します。

チャネルを作成すると、実行時のログはデフォルトで無効になります。コンソールまたは AWS Command Line Interface (AWS CLI) を使用して、アカウントのチャネルごとに実行時のログ状態を有効または無効にできます。

As Run ログを有効にすると、MediaTailor はサービスにリンクされたロールを自動的に作成し、MediaTailor が CloudWatch Logs アカウントで As Run ログを書き込んで管理できるようにします。サービスにリンクされたロールの詳細については、「[MediaTailor 向けのサービスリンクロールの使用](using-service-linked-roles.md)」を参照してください。

**注記**  
As Run Log は現在、デフォルトのプログラムのみをサポートしています。現時点では、プログラムルールによって作成された alternateMedia はサポートされていません。つまり、現在 alternateMedia の実行中ログは生成されません。

**Topics**
+ [As Run ログの有効化](enabling-as-run-log.md)
+ [As Run ログの無効化](disabling-as-run-log.md)

# As Run ログの有効化
<a name="enabling-as-run-log"></a>

As Run ログを有効にするには、チャネル名を指定し、そのチャネルの *As Run* ログタイプを有効にします。

------
#### [ Console ]

**チャネルの作成時に As Run ログを有効にするには**

1. にサインイン AWS マネジメントコンソール し、[https://console.aws.amazon.com/mediatailor/](https://console.aws.amazon.com/mediatailor/) で MediaTailor コンソールを開きます。

1. ナビゲーションペインで、**[Channel assembly]** (チャネルアセンブリ) > **[Channels]** (チャネル) とクリックします。

1. ナビゲーションバーで、**[Create channel]** (チャネルを作成) をクリックします。

1. **チャンネルの詳細の設定**、**出力の設定**、**アクセスコントロール**ペインで、必要に応じてチャンネルを設定します。

1. **アクセスコントロール**ペインで、**次へ**を選択します。

1. **ログペイン**の **ログタイプ** で、**実行として有効化** を選択して実行ログを有効にします。

**チャネルの更新時に As Run ログを有効にするには**
**注記**  
チャネルが現在実行中の場合は、更新する前にそのチャネルを停止する必要があります。チャネルを停止したら、**アクション** > **編集**を選択してチャネルの更新を開始できます。

1. にサインイン AWS マネジメントコンソール し、[https://console.aws.amazon.com/mediatailor/](https://console.aws.amazon.com/mediatailor/) で MediaTailor コンソールを開きます。

1. ナビゲーションペインで、**[Channel assembly]** (チャネルアセンブリ) > **[Channels]** (チャネル) とクリックします。

1. 更新するチャネルを選択して、As Run ログを有効にします。

1. **[Actions]** (アクション)、**[Edit]** (編集) の順に選択します。

1. **チャネルの詳細の設定**、**出力の設定**、**アクセスコントロール**ペインで、必要に応じてチャネル設定を更新します。

1. **アクセスコントロール**ペインで、**次へ**を選択します。

1. **ログペイン**の **ログタイプ** で、**実行として有効化** を選択して実行ログを有効にします。

****ログ記録**タブから As Run ログを有効にするには**
**注記**  
チャネルが現在実行中の場合は、**Actions** > **Edit** を選択して As Run ログを有効にする代わりに、**Logging** タブを使用する必要があります。

1. にサインイン AWS マネジメントコンソール し、[https://console.aws.amazon.com/mediatailor/](https://console.aws.amazon.com/mediatailor/) で MediaTailor コンソールを開きます。

1. ナビゲーションペインで、**[Channel assembly]** (チャネルアセンブリ) > **[Channels]** (チャネル) とクリックします。

1. As Run ログを有効にするチャネルを選択します。

1. チャネルの名前の下にあるナビゲーションバーで、**ログ記録**を選択します。

1. **ログ記録** > **ログタイプ**で、**As run **を選択して As Run ログを有効にします。

------
#### [ AWS Command Line Interface (AWS CLI) ]

**As Run ログを有効にするには**

[configure-logs-for-channel](https://docs.aws.amazon.com/cli/latest/reference/mediatailor/configure-logs-for-channel.html) コマンドを実行し、必要なパラメータに適切な値を指定します。

この例は Linux、macOS、または Unix 用にフォーマットされており、読みやすさを向上させるためにバックスラッシュ (\$1) の行継続文字を使用しています。

```
$ aws mediatailor configure-logs-for-channel \
--channel-name MyChannel \
--log-types AS_RUN
```

この例は Microsoft Windows 用にフォーマットされており、読みやすさを向上させるためにキャレット (^) の行継続文字を使用しています。

```
C:\> aws mediatailor configure-logs-for-channel ^
--channel-name MyChannel ^
--log-types AS_RUN
```

上記の中で、
+ `MyChannel` は、所有していて As Run ログを有効にするチャネルの名前です。

コマンドが正常に実行された場合は、以下のような出力が表示されます。

```
{
    "ChannelName": "MyChannel",
    "LogTypes": [
       "AS_RUN"
    ]
}
```

------

# As Run ログの無効化
<a name="disabling-as-run-log"></a>

有効にしたチャネルの As Run ログを無効にするには、チャネル名を指定し、そのチャネルの *As Run* ログタイプを無効にします。

------
#### [ Console ]

**チャネルの更新時に As Run ログを無効にするには**
**注記**  
チャネルが現在実行中の場合は、更新する前にそのチャネルを停止する必要があります。チャネルを停止したら、**アクション** > **編集**を選択してチャネルの更新を開始できます。

1. にサインイン AWS マネジメントコンソール し、[https://console.aws.amazon.com/mediatailor/](https://console.aws.amazon.com/mediatailor/) で MediaTailor コンソールを開きます。

1. ナビゲーションペインで、**[Channel assembly]** (チャネルアセンブリ) > **[Channels]** (チャネル) とクリックします。

1. 更新するチャネルを選択して、As Run ログを有効にします。

1. **[Actions]** (アクション)、**[Edit]** (編集) の順に選択します。

1. **「チャネルの詳細の設定**」、**「出力の設定**」、および**「アクセスコントロール**」ペインで、必要に応じてチャネル設定を更新します。

1. **アクセスコントロール**ペインで、**次へ**を選択します。

1. **ログペイン**の**ログタイプ**で、**実行として有効に**して実行ログを無効にします。

****ログ記録**タブから As Run ログを無効にするには**
**注記**  
チャネルが現在実行中の場合は、**Actions** > **Edit** を選択して As Run ログを無効にする代わりに、**Logging** タブを使用する必要があります。

1. にサインイン AWS マネジメントコンソール し、[https://console.aws.amazon.com/mediatailor/](https://console.aws.amazon.com/mediatailor/) で MediaTailor コンソールを開きます。

1. ナビゲーションペインで、**[Channel assembly]** (チャネルアセンブリ) > **[Channels]** (チャネル) とクリックします。

1. As Run ログを無効にするチャネルを選択します。

1. チャネルの名前の下にあるナビゲーションバーで、**ログ記録**を選択します。

1. **ログ記録** > **ログタイプ**で、**As run** をクリアして As Run ログを無効にします。

------
#### [ AWS Command Line Interface (AWS CLI) ]

**As Run ログを無効にするには**

[configure-logs-for-channel](https://docs.aws.amazon.com/cli/latest/reference/mediatailor/configure-logs-for-channel.html) コマンドを実行し、必要なパラメータに適切な値を指定します。

この例は Linux、macOS、または Unix 用にフォーマットされており、読みやすさを向上させるためにバックスラッシュ (\$1) の行継続文字を使用しています。

```
$ aws mediatailor configure-logs-for-channel \
--channel-name MyChannel \
--log-types
```

この例は Microsoft Windows 用にフォーマットされており、読みやすさを向上させるためにキャレット (^) の行継続文字を使用しています。

```
C:\> aws mediatailor configure-logs-for-channel ^
--channel-name MyChannel ^
--log-types
```

上記の中で、
+ `MyChannel` は、所有し、As Run ログを無効にするチャネルの名前です。

コマンドが正常に実行された場合は、以下のような出力が表示されます。

```
{
    "ChannelName": "MyChannel",
    "LogTypes": []
}
```

------

# AWS Elemental MediaTailor Amazon CloudWatch Logs Insights での ADS ログ分析
<a name="monitor-cloudwatch-ads-logs"></a>

Amazon CloudWatch Logs Insights を使用して、 AWS Elemental MediaTailor 広告決定サーバー (ADS) ログを表示およびクエリできます。MediaTailor は、通常の処理とエラー状態に関するイベントログを CloudWatch に送信します。ログは JSON スキーマに従っています。CloudWatch Logs Insights を使用して、時間枠ごとにログを選択してから、それらに対してクエリを実行できます。

一般情報については、「[CloudWatch Logs Insights を使用したログデータの分析](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html)」を参照してください。

**注記**  
ログにアクセスするには、Amazon CloudWatch にアクセスするための許可が必要です。手順については、「[Amazon CloudWatch Logs のアクセス許可](monitoring-permissions.md)」を参照してください。

**CloudWatch コンソールを使用して ADS ログを表示してクエリする**

1. CloudWatch コンソール ([https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/)) を開きます。

1. ナビゲーションペインの **[Logs]** (ログ) で **[Insights]** (インサイト) をクリックします。

1. 検索バーで と入力し**AdDec**、ドロップダウンリストから を選択します`MediaTailor/AdDecisionServerInteractions`。

1. (オプション) 調査する期間を調整します。

1. (オプション) ダイアログボックスでクエリを変更します。一般的なガイダンスについては、「[CloudWatch Logs Insights のクエリ構文](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html)」を参照してください。MediaTailor ADS に関するクエリの例については、「[ADS ログのクエリ](querying-the-ads-logs.md)」を参照してください。

1. **[Run query]** (クエリの実行) を選択します。クエリには数秒かかる場合があり、その間は **[Run query]** (クエリの実行) の代わりに **[Cancel]** (キャンセル) が表示されます。

1. (オプション) 結果を CSV ファイルとしてエクスポートするには、[**アクション**]、[**クエリ結果のダウンロード (CSV) **]の順に選択します。

**注記**  
コンソールは、クエリ結果で返されるレコードとエクスポートされるレコードの数を制限するため、バルクデータには API、 AWS Command Line Interface (AWS CLI)、または SDK を使用します。

**Topics**
+ [ADS ログのクエリ](querying-the-ads-logs.md)

# ADS ログのクエリ
<a name="querying-the-ads-logs"></a>

CloudWatch Logs は、ログをクエリするための豊富なオプションを提供します。クエリ構文に関する詳細情報については、「[CloudWatch Logs Insights のクエリ構文](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html)」を参照してください。このセクションには、ADS ログクエリの使用を開始するための一般的なクエリの例が記載されています。すべてのクエリは、現在の時間範囲設定のログに対して実行されます。

以下のクエリは、ADS ログからすべての情報を取得します。

```
fields @timestamp, eventType, sessionId, requestId, @message
| sort sessionId, @timestamp asc
```

以下のクエリは、ADS に対するすべてのリクエストを取得します。このクエリは、MediaTailor ログのリクエストヘッダーコンテンツを取得する方法を示しています。

```
fields @timestamp, adsRequestUrl, requestHeaders.0.value as @userAgent, requestHeaders.1.value as @xForwardedFor, sessionId, requestId
| filter eventType = "MAKING_ADS_REQUEST"
| sort @timestamp asc
```

以下のクエリは、MediaTailor が所定のセッションに挿入した広告を取得します。

```
fields @timestamp, sessionId, requestId, @message
| filter eventType = "FILLED_AVAIL"
| sort @timestamp asc
```

以下のクエリは、MediaTailor がプレイヤーに代わって呼び出した追跡 URL を取得します。

```
fields @timestamp, beaconInfo.trackingEvent, beaconInfo.beaconUri, beaconInfo.headers.0.value as @userAgent, beaconInfo.headers.1.value as @xForwardedFor, sessionId, requestId
| filter eventType = "BEACON_FIRED"
| sort @timestamp asc
```

以下のクエリは、`sessionId` で結果をフィルタリングすることによって、特定の再生セッションの情報を取得します。

```
fields @timestamp, eventType, sessionId, requestId, @message
| filter sessionId = "0aaf6507-c6f9-4884-bfe7-f2f841cb8195"
| sort @timestamp asc
```

以下のクエリは、`requestId` で結果をフィルタリングすることによって、単一のリクエストの情報を取得します。

```
fields @timestamp, eventType, sessionId, requestId, @message
| filter requestId = "f5d3cf39-6258-4cf1-b3f6-a34ff8bf641d"
| sort @timestamp asc
```

以下のクエリは、ログに記録された各イベントタイプのログエントリの数を取得します。

```
fields eventType
| stats count() as @eventCount by eventType
```

以下のクエリは、広告をスキップしたすべての avail に対する avail ID とスキップされた広告のリストを取得します。

```
fields avail.availId
| parse @message '"skippedAds":[*]' as @skippedAdsList
| filter ispresent(@skippedAdsList)
```

# AWS Elemental MediaTailor ログのボリュームの制御
<a name="log-configuration"></a>

MediaTailor 広告挿入セッションログは、冗長になる場合があります。ログコストを削減するため、MediaTailor が Amazon CloudWatch Logs に送信するセッションログの割合を定義することができます。例えば、再生設定に 1,000 個の広告挿入セッションがあり、有効な割合の値を `60` に設定する場合、MediaTailor は 600 個のセッションに関するログを CloudWatch Logs に送信します。MediaTailor は、ログを送信するセッションをランダムに決定します。特定のセッションに関するログを表示するには、[デバッグログモード](debug-log-mode.md)を使用できます。

ログの割合を設定すると、MediaTailor は、アカウントに CloudWatch のログを書き込むために必要な許可を MediaTailor に付与するサービスリンクロールを自動的に作成します。MediaTailor がサービスリンクロールを使用する方法については、「[MediaTailor 向けのサービスリンクロールの使用](using-service-linked-roles.md)」を参照してください。

## ログ設定の作成
<a name="creating-log-configuration"></a>

MediaTailor が CloudWatch Logs に書き込むセッションログの割合を制御するには、再生設定の*ログ設定*を作成します。ログ設定を作成するときは、*再生設定名*と*有効な割合*の値を指定します。

------
#### [ Console ]

***既存の*再生設定のログ設定を作成するには**

1. にサインイン AWS マネジメントコンソール し、[https://console.aws.amazon.com/mediatailor/](https://console.aws.amazon.com/mediatailor/) で MediaTailor コンソールを開きます。

1. **[Playback configuration]** (再生設定) ペインで、ログ設定を作成する再生設定を選択します。

1. **[Edit]** (編集) をクリックします。

1. **[Log configuration]** (ログ設定) で、**[percent enabled]** (有効な割合) 値を指定します。

***新しい*再生設定のログ設定を作成するには**
+ [ログ設定](configurations-create.md#configurations-log-configurations) の手順を実行します。

------
#### [ AWS Command Line Interface (AWS CLI) ]

***既存*の再生設定のログ設定を作成する**

を使用してログ設定を作成するには AWS CLI、[configure-logs-for-playback-configuration](https://docs.aws.amazon.com/cli/latest/reference/mediatailor/configure-logs-for-playback-configuration.html) コマンドを実行し、必要なパラメータに適切な値を指定します。

この例は Linux、macOS、または Unix 用にフォーマットされており、読みやすさを向上させるためにバックスラッシュ (\$1) の行継続文字を使用しています。

```
$ aws mediatailor configure-logs-for-playback-configuration \
--percent-enabled 10 \
--playback-configuration-name MyPlaybackConfiguration
```

この例は Microsoft Windows 用にフォーマットされており、読みやすさを向上させるためにキャレット (^) の行継続文字を使用しています。

```
C:\> aws mediatailor configure-logs-for-playback-configuration ^
--percent-enabled 10 ^
--playback-configuration-name MyPlaybackConfiguration
```

上記の中で、
+ `percent-enabled` は、MediaTailor が CloudWatch Logs に送信する再生設定セッションログの割合です。
+ `playback-configuration-name` は、ログ設定を作成している再生設定の名前です。

コマンドが正常に実行された場合は、以下のような出力が表示されます。

```
{
    "PercentEnabled": 10,
    "PlaybackConfigurationName": "MyPlaybackConfiguration"
}
```

***新しい*再生設定のログ設定を作成するには**
+ put[put-playback-configuration](https://docs.aws.amazon.com/cli/latest/reference/mediatailor/put-playback-configuration.html) コマンドには `configure-logs-for-playback-configuration`オプションを使用します。

------

## ログ設定の非アクティブ化
<a name="deactivating-logging-configuration"></a>

ログ設定を作成した後は、ログ設定を削除することはできません。*無効に*することしかできません。ログ設定を無効にするには、MediaTailor コンソールまたは API を使用して、**有効率**の値を **0** に設定します。そうすることで、その再生設定のすべてのセッションログがオフになります。

アカウント内のログ設定用に MediaTailor が使用するサービスリンクロールを削除する場合は、まずすべてのログ設定を非アクティブにする必要があります。サービスリンクロールの削除方法については、「[MediaTailor 向けのサービスリンクロールの使用](using-service-linked-roles.md)」を参照してください。

------
#### [ Console ]

**再生設定のログ設定を非アクティブにする**

1. にサインイン AWS マネジメントコンソール し、[https://console.aws.amazon.com/mediatailor/](https://console.aws.amazon.com/mediatailor/) で MediaTailor コンソールを開きます。

1. **[Playback configuration]** (再生設定) ペインで、ログ設定を非アクティブにする再生設定を選択します。

1. **[編集]** を選択します。

1. **[Log configuration]** (ログ設定) で、**[percent enabled]** (有効な割合) 値を `0` に設定します。そうすることで、この再生設定のすべてのセッションログがオフになります。

1. **[Save]** (保存) をクリックします。

------
#### [ AWS Command Line Interface (AWS CLI) ]

**ログ設定を非アクティブにする**
+ [configure-logs-for-playback-configuration](https://docs.aws.amazon.com/cli/latest/reference/mediatailor/configure-logs-for-playback-configuration.html) コマンドを使用して、`percent-enabled` 値を `0` に設定します。

------

# AWS Elemental MediaTailor ログとイベントのフィルタリング
<a name="logs-filter"></a>

MediaTailor の再生設定から出力されるログには、再生セッション中に発生するさまざまなアクティビティに関する情報が含まれます。これらのアクティビティは、ログのイベントタイプで識別されます。多くのイベントはデフォルトでログに記録されます。Amazon CloudWatch のログのコストを制御するために、MediaTailor が出力するログを指定できます。

MediaTailor では、ログフィルタリングを制御できるため、以下を実行できます。
+ ログから除外するログイベントを指定する
+ 広告決定サーバー (ADS) からの raw レスポンスのログ記録を有効にする

これらのログフィルタリング設定は、再生セッションごとに個別に設定することも、再生設定のすべての再生セッションのデフォルトとして設定することもできます。
+ セッションごとにログをフィルタリングするには、再生セッションの初期化リクエストにクエリパラメータを含めます。
+ 再生設定ごとにログをフィルタリングするには、MediaTailor コンソールまたは API を使用して、再生設定で設定を指定します。

以下のセクションでは、セッションと再生設定でログフィルタリングを有効にする手順について説明します。

# セッションごとのログフィルター
<a name="logs-filter-session"></a>

各セッションのカスタマイズされたログ詳細レベルを定義するには、最初のサーバー側またはクライアント側の再生セッションリクエストに次のパラメータを追加します。パラメータに値を追加して、含めるイベントまたは除外するイベントをカンマ区切り形式で表します。
+ `aws.adsInteractionLogPublishOptInEventTypes` は、特定の広告決定サーバー (ADS) インタラクションのログを受信します。
+ `aws.adsInteractionLogExcludeEventTypes` は、特定の ADS インタラクションのログの受信を停止します。
+ `aws.manifestServiceLogExcludeEventTypes` は、特定のマニフェストサービスインタラクションのログの受信を停止します。

MediaTailor が出力するログとイベントタイプのリストについては、「」、[ADS ログ](ads-log-format.md)「」、[マニフェストログ](log-types.md)「」を参照してください[トランスコードログ](tm-log-format.md)。

ログフィルタリングのクエリパラメータを渡さない場合、MediaTailor はすべてのログを配信先に書き込みます。

**Example ログフィルターを使用したサーバー側のセッションの初期化**  
マニフェストログと ADS ログ`MAKING_ADS_REQUEST`から `GENERATED_MANIFEST`および `PARSING_ERROR`イベントを除外するには、セッション初期化リクエストは次のようになります。  

```
GET <mediatailorURL>/v1/master/<hashed-account-id>/<origin-id>/index.m3u8?aws.logMode=DEBUG&aws.manifestServiceLogExcludeEventTypes=GENERATED_MANIFEST,PARSING_ERROR&aws.adsInteractionLogExcludeEventTypes=MAKING_ADS_REQUEST
```
ADS から raw ログを有効にするには、 `AdsInteractionPublishOptInEventType`パラメータ`RAW_ADS_RESPONSE`の値を含めます。  

```
GET <mediatailorURL>/v1/master/<hashed-account-id>/<origin-id>/index.m3u8?aws.adsInteractionPublishOptInEventType=RAW_ADS_RESPONSE
```

**Example ログフィルターを使用したクライアント側のセッションの初期化**  
クライアント側のセッション初期化中にログイベントを除外するには、MediaTailor へのクライアントの POST リクエストに `availSuppression`および ログタイプパラメータを含めます。クライアント側の再生セッションリクエストを作成する方法の詳細については、「[クライアント側の広告追跡](ad-reporting-client-side.md)」を参照してください。次の例では、マニフェストログ`CONFIG_SECURITY_ERROR`と ADS ログ`MAKING_ADS_REQUEST`から および `PARSING_ERROR`イベントを除外します。  

```
POST parent.m3u8
   {
       "adsInteractionLog": {
           ...
           "excludeEventTypes": [
               "MAKING_ADS_REQUEST"
           ]
       },
       "manifestServiceLog": {
           ...
           "excludeEventTypes": [
               "GENERATED_MANIFEST",
               "PARSING_ERROR"
           ]
       },
      "logMode": "DEBUG"
   }
```
 ADS から raw ログを有効にするには、 `publishOptInEventTypes`パラメータ`RAW_ADS_RESPONSE `の値を含めます。  

```
POST parent.m3u8
   {
       "adsInteractionLog": {
           "publishOptInEventTypes": ["RAW_ADS_RESPONSE"],
           "excludeEventTypes": [
               "MAKING_ADS_REQUEST"
           ]
       },
       "manifestServiceLog": {
           ...
           "excludeEventTypes": [
               "GENERATED_MANIFEST",
               "PARSING_ERROR"
           ]
       },
       "logMode": "DEBUG"
   }
```

# 再生ごとの設定ログフィルター
<a name="logs-filter-config"></a>

再生設定を使用して、MediaTailor がこの再生設定からデフォルトとして出力するログイベントタイプを定義します。MediaTailor は、セッション初期化リクエストのクエリパラメータのフィルタリングを含まないすべてのセッションに対して、これらのデフォルトのログフィルタリング設定を使用します。

以下を実行できます。
+ 特定の広告決定サーバー (ADS) インタラクションのログを受信します。
+ 特定の ADS インタラクションのログを除外します。
+ 特定のマニフェストサービスインタラクションのログを除外します。

MediaTailor コンソールからこれらの設定を行うには、「」を参照してください[設定の作成](configurations-create.md)。MediaTailor API については、 API *AWS Elemental MediaTailor リファレンス*[https://docs.aws.amazon.com/mediatailor/latest/apireference/API_PutPlaybackConfiguration.html](https://docs.aws.amazon.com/mediatailor/latest/apireference/API_PutPlaybackConfiguration.html)の「」を参照してください。

MediaTailor が出力するログとイベントタイプのリストについては、「」、[ADS ログ](ads-log-format.md)「」、[マニフェストログ](log-types.md)「」を参照してください[トランスコードログ](tm-log-format.md)。

# AWS Elemental MediaTailor デバッグログの生成
<a name="debug-log-mode"></a>

デバッグログを使用して、MediaTailor 広告挿入の再生セッション問題をトラブルシューティングします。デバッグログを生成するには、MediaTailor に対するプレイヤーのリクエストのログモードをデバッグに設定します。サーバー側のレポートの場合は、*再生リクエスト*でログモードを設定します。クライアント側のレポートの場合は、*セッション開始リクエスト*でログモードを設定します。

ログモードがデバッグに設定されている場合、MediaTailor はすべてのログイベントタイプを CloudWatch Logs に書き込みます。ログは、以下のイベントに関する情報を提供します。デバッグログで生成されるデータの完全なリストについては、「[デバッグログのフィールド](https://docs.aws.amazon.com/mediatailor/latest/ug/debug-log-mode.html#debug-log-mode-fields)」を参照してください。
+ **オリジンインタラクション** – オリジンサーバーとの MediaTailor インタラクション に関する詳細。例えば、オリジンマニフェストレスポンス、マニフェストタイプ、およびオリジン URL などです。
+ **生成されたマニフェスト** - MediaTailor からの再生セッションレスポンスに関する詳細情報。例えば、MediaTailor が生成するマニフェストなどです。
+ **開始されたセッション** - セッション ID などのセッション開始に関する詳細情報。

セッションごとに受け取るログイベントタイプをカスタマイズするには、「」を参照してください[ログとイベントのフィルタリング](logs-filter.md)。

## 前提条件
<a name="prerequisites"></a>

ログモードをデバッグに設定するには、まず CloudWatch にログを送信するための許可を MediaTailor に付与する必要があります (まだ付与していない場合)。CloudWatch にアクセスするための許可を MediaTailor に付与したら、デバッグログモードを有効にする準備が整います。CloudWatch にアクセスするための許可を MediaTailor に付与する方法については、「[Amazon CloudWatch の許可のセットアップ](https://docs.aws.amazon.com/mediatailor/latest/ug/monitoring-permissions.html)」を参照してください。

## ログモードをデバッグに設定する方法
<a name="how-to-turn-on-debug-log-mode"></a>

このセクションでは、サーバー側のレポートとクライアント側のレポートのログモードをデバッグに設定する方法を説明します。

### サーバー側のレポート
<a name="server-side-reporting"></a>

サーバー側のレポートの場合、HLS または DASH MediaTailor エンドポイントに対するプレイヤーの `GET HTTP` 再生リクエストに `?aws.logMode=DEBUG` クエリのパラメータと値を含めます。サーバー側のレポートに関する一般情報については、「[サーバー側のレポート](https://docs.aws.amazon.com/mediatailor/latest/ug/ad-reporting-server-side.html)」を参照してください。

**重要**  
`DEBUG` 値では、大文字と小文字が区別されます。

 `?aws.logMode=DEBUG` が含まれる再生リクエストは、以下のようになります。

**Example HLS エンドポイントに対する再生リクエスト**  

```
GET <mediatailorURL>/v1/master/<hashed-account-id>/<origin-id>/<asset-id>?aws.logMode=DEBUG
```
ログモードをデバッグに設定した後は、デバッグログセッションがアクティブであることを確認することが推奨されます。デバッグセッションがアクティブであることを確認するには、そのセッション ID に関する CloudWatch のログが存在するかどうかをチェックします。セッション ID は、MediaTailor が提供する再生エンドポイントに含まれています。詳細については、「[Verify that the debug log mode is active for your playback session](#debug-active)」を参照してください。

### クライアント側のレポート
<a name="client-side-reporting"></a>

クライアント側のレポートの場合は、MediaTailor の /v1/session エンドポイントに対するクライアントの `POST HTTP` セッション開始リクエストボディに `logMode` キーと `DEBUG` 値を含めます。クライアント側のレポートに関する一般情報については、「[クライアント側のレポート](https://docs.aws.amazon.com/mediatailor/latest/ug/ad-reporting-client-side.html)」を参照してください。

**重要**  
`DEBUG` 値では、大文字と小文字が区別されます。

 ログモードをデバッグに設定した後は、デバッグセッションがアクティブであることを確認することが推奨されます。デバッグセッションがアクティブであることを確認するには、そのセッション ID に関連付けられた `SESSION_INITIALIZED` イベントが CloudWatch のログにあるかどうかを確認します。セッション ID は、MediaTailor が提供する再生エンドポイントに含まれています。詳細については、「[Verify that the debug log mode is active for your playback session](#debug-active)」を参照してください。

## アクティブなデバッグセッションの最大数
<a name="maximum-active-debug-log-sessions"></a>

アクティブなデバッグログセッションは、最大 10 個まで設定できます。プレイヤーがそのセッション開始または再生リクエストを MediaTailor に送信すると、MediaTailor がこの制限に到達しているかどうかをチェックします。到達している場合、MediaTailor は古いセッションがあるかどうかをチェックします。セッションは、一定期間内にアクセスされなかった場合に古いと見なされます。この期間は、ライブストリームの場合は 10 分、VOD ストリームの場合は 30 分です。

アクティブなデバッグログセッション数の上限に到達した場合、セッションに関するデバッグログは CloudWatch Logs に書き込まれません。セッションに関するデバッグログが CloudWatch Logs にない場合は、この上限に到達している可能性があります。制限に到達したかどうかを確認するには、「[Verify that the debug log mode is active for your playback session](#debug-active)」を参照してください。

## デバッグログのフィールド
<a name="debug-log-mode-fields"></a>

 以下の表は、MediaTailor が CloudWatch に書き込むデバッグログのフィールドのリストです。


| フィールド | 説明 | 
| --- | --- | 
| awsAccountId |  AWS アカウント ID。 | 
| customerId | MediaTailor カスタマー ID。 | 
| eventTimestamp | デバッグログイベントに関連付けられた ISO 8601 タイムスタンプ。 | 
| eventType | デバッグログイベントのタイプ。値:[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/mediatailor/latest/ug/debug-log-mode.html) | 
| originRequestUrl | このリクエスト用に取得されたオリジンサーバーの URL。 | 
| mediaTailorPath | 呼び出された MediaTailor エンドポイント。最初のマニフェストリクエストで MediaTailor に渡されたパラメータが含まれます。 | 
| requestId | MediaTailor に対する特定の HTTP リクエストの ID。 | 
| responseBody | MediaTailor からのレスポンスボディ内のマニフェスト。これは、raw オリジンマニフェストか、MediaTailor によって生成されたマニフェストのどちらかになります。 | 
| sessionId | 再生セッション ID。 | 
| sessionType | 再生セッションのタイプ。値: `HLS`、`DASH` | 

## デバッグログを読み取る
<a name="read-the-debug-logs"></a>

MediaTailor は、Amazon CloudWatch Logs にデバッグログを書き込みます。これには、一般的な CloudWatch Logs 料金が適用されます。デバッグログの読み取りには CloudWatch Insights を使用してください。CloudWatch Logs Insights の使用方法については、*AWS CloudWatch Logs ユーザーガイド*の「[CloudWatch Logs Insights を使用したログデータの分析](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html)」を参照してください。

**注記**  
デバッグログが CloudWatch に表示されるには、数分かかる場合があります。ログが表示されない場合は、数分待ってから再試行してください。それでもログが表示されない場合は、アクティブなデバッグログセッションの最大数に到達している可能性があります。到達しているかどうかを確認するには、CloudWatch クエリを実行して、再生セッション向けに開始されたデバッグセッションがあったかどうかを調べます。詳細については、「[Verify that the debug log mode is active for your playback session](#debug-active)」を参照してください。

### 例
<a name="query-examples"></a>

 このセクションには、MediaTailor のデバッグログデータの読み取りに使用できるサンプルクエリが記載されています。

**Example 1: 再生セッションのデバッグログモードがアクティブであることを確認する**  

```
fields @timestamp, @message
 | filter sessionId = "32002de2-837c-4e3e-9660-f3075e8dfd90"
 | filter eventType = "SESSION_INITIALIZED" # client-side reporting
 or mediaTailorPath like “/v1/master" # server-side reporting HLS
 or mediaTailorPath like “/v1/dash" # server-side reporting DASH
```

**Example 2: オリジンからのレスポンスを表示する**  

```
fields @timestamp, responseBody, @message, mediaTailorPath
 | filter eventType = "ORIGIN_MANIFEST" and sessionId = "32002de2-837c-4e3e-9660-f3075e8dfd90"
```

**Example 3: 所定のセッションについて MediaTailor が生成したマニフェストを表示する**  

```
fields @timestamp, responseBody, @message
 | filter mediaTailorPath like "/v1/master/" and eventType = "GENERATED_MANIFEST" and sessionId = "32002de2-837c-4e3e-9660-f3075e8dfd90"
```

**Example 4: 所定の `requestId` に関するすべてのイベントを表示する**  
 このクエリを使用して、オリジンマニフェストと MediaTailor によって生成されたマニフェストを表示します。  

```
fields @timestamp, responseBody, @message, mediaTailorPath
 | filter requestId = "e5ba82a5-f8ac-4efb-88a0-55bed21c45b4"
```