How to enable error logging for OpenSearch (Serverless)

0

All the instructions I see for enabling cloudwatch logging is with the cluster and domain option. Does there exist a way to log for the serverless offering?

1 Answer
0

Yes, it is possible to enable error logging for Amazon OpenSearch Serverless, although the process differs from the traditional OpenSearch Service domains.

For OpenSearch Serverless, logging is primarily handled through AWS CloudTrail integration. CloudTrail automatically records API calls made to OpenSearch Serverless, including those from the AWS Management Console and code calls to the OpenSearch Serverless API operations. This logging is enabled by default when you create an AWS account.

To set up more comprehensive logging for OpenSearch Serverless:

  1. Create a trail in CloudTrail if you haven't already. This allows CloudTrail to deliver log files to an Amazon S3 bucket.

  2. Configure the trail to log events from all regions in your AWS partition.

  3. You can further analyze and act upon the event data collected in CloudTrail logs by configuring other AWS services.

  4. For application-specific logging, you can use Amazon OpenSearch Ingestion to set up a pipeline that sends logs to your OpenSearch Serverless collection. This involves:

  • Creating an OpenSearch Serverless collection
  • Setting up an OpenSearch Ingestion pipeline
  • Configuring a CloudWatch Logs subscription to send logs to the pipeline
  1. When creating the OpenSearch Ingestion pipeline, you'll have the option to set up log publishing to CloudWatch. Choose to create a new CloudWatch log group or use an existing one to write the ingestion logs.

This approach allows you to capture both API-level activities through CloudTrail and application-specific logs through the OpenSearch Ingestion pipeline, providing comprehensive logging capabilities for OpenSearch Serverless.
Sources
Logging OpenSearch Serverless API calls using AWS CloudTrail - Amazon OpenSearch Service
Deliver Amazon CloudWatch logs to Amazon OpenSearch Serverless | AWS Big Data Blog
Use Amazon OpenSearch Ingestion to migrate to Amazon OpenSearch Serverless | AWS Big Data Blog

profile picture
answered 3 months ago
AWS
SUPPORT ENGINEER
reviewed 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions