Getting started
After deploying the solution, refer to this section to quickly learn how to use Centralized Logging with OpenSearch for log ingestion (AWS CloudTrail logs as an example), and log visualization.
You can also choose to start with Domain management, then build AWS Service Log Analytics Pipelines and Application Log Analytics Pipelines.
Steps
-
Step 1: Import an Amazon OpenSearch Service domain. Import an existing Amazon OpenSearch Service domain into the solution.
-
Step 2: Create Access Proxy. Create a public access proxy, which allows you to access the templated dashboard from anywhere.
-
Step 3: Ingest CloudTrail Logs. Ingest CloudTrail logs into the specified Amazon OpenSearch Service domain.
-
Step 4: Access built-in dashboard. View the dashboard of CloudTrail logs.
Step 1: Import an Amazon OpenSearch Service domain
To use the Centralized Logging with OpenSearch solution for the first time, you must import Amazon OpenSearch Service domains first.
Centralized Logging with OpenSearch supports Amazon OpenSearch Service domain with fine-grained access control enabled within a VPC only.
Important
Currently, Centralized Logging with OpenSearch supports Amazon OpenSearch Service with OpenSearch 1.3 or later.
Prerequisites
At least one Amazon OpenSearch Service domain within VPC. If you don't have an Amazon OpenSearch Service domain yet, you can create an Amazon OpenSearch Service domain within VPC. See Launching your Amazon OpenSearch Service domains within a VPC.
Steps
Use the following procedure to import an Amazon OpenSearch Service domain through the Centralized Logging with OpenSearch console.
-
Sign in to the Centralized Logging with OpenSearch console (see instructions for accessing the console using Amazon Cognito user pool or OIDC).
-
In the navigation pane, under Domains, choose Import OpenSearch Domain.
-
On the Step 1. Select domain page, choose a domain from the dropdown list.
-
Choose Next.
-
On the Step 2. Configure network page, under Network creation, choose Automatic. If your Centralized Logging with OpenSearch and OpenSearch domains reside in two different VPCs, the Automatic mode will create a VPC Peering Connection between them, and update route tables. See details in Set up VPC Peering.
-
On the Step 3. Create tags page, choose Import.
Step 2: Create Access Proxy
Note
Access proxy is optional and it incurs additional cost. If you can connect to Amazon OpenSearch Service's VPC (such as through a VPN connection), you don't need to activate an access proxy. You must use it only if you want to connect to the Amazon OpenSearch Service dashboard from the public internet.
You can create a NGINX proxy and create a DNS record pointing to the proxy, so that you can access the Amazon OpenSearch Service dashboard securely from a public network. For more information, refer to Access Proxy.
Create a NGINX proxy
-
Sign in to the Centralized Logging with OpenSearch console (see instructions for accessing the console using Amazon Cognito user pool or OIDC).
-
In the navigation pane, under Domains, choose OpenSearch domains.
-
Select the domain from the table.
-
Under General configuration, choose Enable at the Access Proxy label.
-
On the Create access proxy page, under Public access proxy, select at least 2 subnets that contain
CLVpc/DefaultVPC/publicSubnetX
for the Public Subnets. -
For Public Security Group, choose the Security Group that contains
ProxySecurityGroup
. -
Choose the NGINX Instance Key Name.
-
Enter the Domain Name.
-
Choose the associated Load Balancer SSL Certificate that applies to the domain name.
-
Choose Create.
After provisioning the proxy infrastructure, you must create an associated DNS record in your DNS resolver. The following introduces how to find the Application Load Balancer domain, and then create a CNAME record pointing to this domain.
Create a DNS record
-
Sign in to the Centralized Logging with OpenSearch console (see instructions for accessing the console using Amazon Cognito user pool or OIDC).
-
In the navigation pane, under Domains, choose OpenSearch domains.
-
Select the domain from the table.
-
Choose the Access Proxy tab. Find Load Balancer Domain, which is the Application Load Balancer domain.
-
Go to the DNS resolver, and create a CNAME record pointing to this domain. If your domain is managed by Amazon RouteĀ 53
, refer to Creating records by using the Amazon RouteĀ 53 console.
Step 3: Ingest AWS CloudTrail Logs
You can build a log analytics pipeline to ingest AWS CloudTrail logs.
Important
Make sure your CloudTrail and Centralized Logging with OpenSearch are in the same AWS Region.
-
Sign in to the Centralized Logging with OpenSearch Console (see instructions for accessing the console using Amazon Cognito user pool or OIDC).
-
In the navigation pane, select AWS Service Log Analytics Pipelines.
-
Choose Create a log ingestion.
-
In the AWS Services section, choose
AWS CloudTrail
. -
Choose Next.
-
Under Specify settings, for Trail, select one from the dropdown list.
-
Choose Next.
-
In the Specify OpenSearch domain section, select the imported domain for the Amazon OpenSearch Service domain.
-
Choose
Yes
for Sample dashboard. -
Keep default values and choose Next.
-
Choose Create.
Step 4: Access the dashboard
After the DNS record takes effect, you can access the built-in dashboard from anywhere via proxy.
-
Enter the domain of the proxy in your browser. Alternatively, click the Link button under Access Proxy in the General Configuration section of the domain.
-
Enter your credentials to log in to the Amazon OpenSearch Service Dashboard.
-
Click the username icon of the Amazon OpenSearch Service dashboard from the top right corner.
-
Choose
Switch Tenants
. -
On the Select your tenant page, choose Global, and click Confirm.
-
On the left navigation panel, choose Dashboards.
-
Choose the dashboard created automatically and start to explore your data.