> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deductive.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenSearch

> Connect OpenSearch to Deductive AI to enable reasoning over your opensearch data.

## API Key Authentication Setup

Create an API key for OpenSearch authentication

1. Log in to your OpenSearch cluster
2. Navigate to Security > API Keys
3. Click 'Create API Key'
4. Select permissions: indices:data/read/\*
5. Copy the generated API key immediately
6. Enter your OpenSearch endpoint (e.g., [https://search-logs-prod.us-west-2.es.amazonaws.com](https://search-logs-prod.us-west-2.es.amazonaws.com))
7. Enter your index pattern (e.g., logs-*, app-logs-*)

**Related Documentation**: [View OpenSearch API Access Control Documentation](https://opensearch.org/docs/latest/security/access-control/api-access-control/)

## IAM Role Authentication Setup

Configure IAM role for AWS OpenSearch Service

1. Log in to AWS Console
2. Navigate to IAM > Roles
3. Create or select an IAM role with OpenSearch permissions (es:ESHttpGet, es:ESHttpPost)
4. Configure the role's trust relationship to trust Deductive's AWS account
5. Note the Role ARN (format: arn:aws:iam::\[0-9]{12}:role/YourRoleName)
6. Enter your OpenSearch endpoint (e.g., [https://search-prod-logs.us-east-1.es.amazonaws.com](https://search-prod-logs.us-east-1.es.amazonaws.com))
7. Enter your index pattern (e.g., logs-\*)

**Related Documentation**: [View AWS OpenSearch IAM Documentation](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html)

## Username/Password Authentication Setup

Use basic authentication with OpenSearch

1. Ensure your OpenSearch cluster has internal user database enabled
2. Create a user in OpenSearch Security
3. Assign appropriate roles to the user
4. Note the username and password
5. Enter your OpenSearch endpoint (e.g., [https://opensearch.internal:9200](https://opensearch.internal:9200))
6. Enter your index pattern (e.g., logs-*, app-logs-*)

**Related Documentation**: [View OpenSearch Users & Roles Documentation](https://opensearch.org/docs/latest/security/access-control/users-roles/)

## Field Reference

The following fields are used when configuring this integration:

* **API Key** (`Api Key`)
* **OpenSearch Endpoint** (`Host`)
* **Index or Index Pattern** (`Index`)
* **Password** (`Password`)
* **Role ARN** (`Role arn`)
* **Username** (`Username`)
