IVS Chat Logging
The Chat Logging feature allows you to record all messages in a room to any of three standard locations: an Amazon S3 bucket, Amazon CloudWatch Logs, or Amazon Kinesis Data Firehose. Subsequently, the logs can be used for analysis or building a chat replay that links to a live-video session.
Enable Chat Logging for a Room
Chat Logging is an advanced option that can be enabled by associating a logging configuration with a room. A logging configuration is a resource that allows you to specify a type of location (Amazon S3 bucket, Amazon CloudWatch Logs, or Amazon Kinesis Data Firehose) where messages of a room are logged. For details on creating and managing logging configurations, see Getting Started with Amazon IVS Chat and Amazon IVS Chat API Reference.
You can associate up to three logging configurations with each room, either when creating a new room (CreateRoom) or updating an existing room (UpdateRoom). You can associate multiple rooms with the same logging configuration.
When at least one active logging configuration is associated with a room, every messaging request sent to that room via the Amazon IVS Chat Messaging API is automatically recorded to the specified location(s). These are the average propagation delays (from when a messaging request is sent to when it becomes available in your specified locations):
-
Amazon S3 bucket: 5 minutes
-
Amazon CloudWatch Logs or Amazon Kinesis Data Firehose: 10 seconds
Message Content
Format
{ "event_timestamp": "string", "type": "string", "version": "string", "payload": { "string": "string" } }
Fields
Field | Description |
---|---|
|
UTC timestamp of when the message was received by Amazon IVS Chat. |
|
The Message (Subscribe) or Event (Subscribe) JSON payload that clients will receive from the Amazon IVS Chat service. |
|
Type of the chat message.
|
|
Version of the message-content format. |
Amazon S3 Bucket
Format
Message logs are organized and stored with the following S3 prefix and file format:
AWSLogs/<account_id>/IVSChatLogs/<version>/<region>/room_<resource_id>/<year>/<month>/<day>/<hours>/<account_id>_IVSChatLogs_<version>_<region>_room_<resource_id>_<year><month><day><hours><minutes>_<hash>.log.gz
Fields
Field | Description |
---|---|
|
AWS account ID from which the room is created. |
|
A hash value generated by the system to ensure uniqueness. |
|
The AWS service region where the room was created. |
|
The resource ID part of the room ARN. |
|
Version of the message-content format. |
|
UTC timestamp of when the message was received by Amazon IVS Chat. |
Example
AWSLogs/123456789012/IVSChatLogs/1.0/us-west-2/room_abc123DEF456/2022/10/14/17/123456789012_IVSChatLogs_1.0_us-west-2_room_abc123DEF456_20221014T1740Z_1766dcbc.log.gz
Amazon CloudWatch Logs
Format
Message logs are organized and stored with the following log-stream name format:
aws/IVSChatLogs/<version>/room_<resource_id>
Fields
Field | Description |
---|---|
|
Resource ID part of the room ARN. |
|
Version of the message-content format. |
Example
aws/IVSChatLogs/1.0/room_abc123DEF456
Amazon Kinesis Data Firehose
Message logs are sent to the delivery stream as real-time streaming data to destinations like Amazon Redshift, Amazon OpenSearch Service, Splunk, and any custom HTTP endpoint or HTTP endpoints owned by supported third-party service providers. For more information, see What Is Amazon Kinesis Data Firehose.
Constraints
-
You must own the logging location where messages will be stored.
-
The room, logging configuration, and logging location must be in the same AWS region.
-
Only active logging configurations are available for Chat Logging.
-
You can only delete a logging configuration that is no longer associated with any rooms.
Logging messages to a location that you own requires authorization with your AWS credentials. To give IVS Chat the required access, a resource policy (for an Amazon S3 bucket or CloudWatch Logs) or an AWS IAM Service-Linked Role (SLR) (for Amazon Kinesis Data Firehose) is generated automatically when the logging configuration is created. Be cautious about any modification to the role or policies, as that can impact permission for chat logging.
Monitoring Errors with Amazon CloudWatch
You can monitor errors occurring in chat logging with Amazon CloudWatch, and you can create alarms or dashboards to indicate or respond to the changes of specific errors.
There are several types of errors. For more information, see Monitoring Amazon IVS Chat.