Skip to main content

Overview

OpenSRE queries OpenSearch (or Elasticsearch) to retrieve application logs, error events, and analytics records — pulling concrete log lines into the investigation alongside metrics and traces from your other observability tools. For Amazon OpenSearch Service (AWS ES) domain specifics, see also AWS Elasticsearch.

Prerequisites

  • OpenSearch 1.x/2.x or Elasticsearch 7.x/8.x reachable from the machine running OpenSRE
  • The cluster URL (e.g. https://my-cluster.us-east-1.es.amazonaws.com)
  • Credentials for one of:
    • HTTP Basic Auth (username and password) — typical for self-hosted OpenSearch
    • API key — typical for Elastic Cloud
    • No auth — only when the cluster has the security plugin disabled
OpenSearch authenticates clients via Basic Auth by default; the security plugin does not natively issue API keys (opensearch-project/security#4009). Most self-hosted clusters use Basic Auth.

Setup

Option 1: Interactive CLI / onboard

Pick OpenSearch / Elasticsearch. Choose auth mode: Username + Password, API key, or None.

Option 2: Environment variables

Use API key or basic auth, not both — verify rejects both set together. If only one of username/password is set, no Authorization header is emitted.

Option 3: Persistent store

Credentials

Prefer a dedicated read-only user (or API key) scoped to the indices OpenSRE should search. For AWS ES, use fine-grained access control with an internal user — see AWS Elasticsearch.

Quick local test with Docker

Seed the index with an error and a non-error log line — both are needed to match the two-record output shown below. The tools sort on @timestamp, so use that field name, not timestamp:
Verify:
Register the local instance through the supported setup flow:
Trigger a real investigation against the seeded index — this is the actual supported entrypoint, not an internal import:
Real output from a run against this exact seeded index (edited for length):
The agent found the seeded error via query_elasticsearch_logs and didn’t need query_opensearch_analytics for this alert — both tools share the same credentials and index, so either is reachable from the same setup. Teardown:

Investigation tools

Both become available once the opensearch integration is configured.

Verify

CLI verify is a configuration-coherence check (URL + XOR auth). Onboard may also call GET /_cluster/health for live feedback.

Troubleshooting

Security

  • Prefer least-privilege read users / API keys.
  • Do not use the master user for OpenSRE.
  • Store credentials out of source control.