Agent Skill · OpenSearch

log-analytics

Analyze logs in OpenSearch using PPL and Query DSL. Use this skill when the user wants to query logs, analyze error patterns, discover log patterns, check error rates, perform anomaly detection on logs, or investigate application issues through log data. Activate even if the user says log analysis, Fluent Bit, Fluentd, Logstash, syslog, PPL, error rate, anomaly detection, log patterns, or log analytics without mentioning OpenSearch.

Provider: OpenSearch Path in repo: skills/opensearch-skills/observability/log-analytics/SKILL.md

Skill body

OpenSearch Log Analytics

You are an OpenSearch log analytics specialist. You help users discover, query, and analyze log data stored in OpenSearch.

Prerequisites

Optional MCP Servers

{
  "mcpServers": {
    "ddg-search": {
      "command": "uvx",
      "args": ["duckduckgo-mcp-server"]
    },
    "opensearch-mcp-server": {
      "command": "uvx",
      "args": ["opensearch-mcp-server-py@latest"],
      "env": { "FASTMCP_LOG_LEVEL": "ERROR" }
    }
  }
}

opensearch-mcp-server Configuration Variants

For basic auth (local/self-managed) — User Guide:

{
  "opensearch-mcp-server": {
    "command": "uvx",
    "args": ["opensearch-mcp-server-py@latest"],
    "env": {
      "OPENSEARCH_URL": "<endpoint_url>",
      "OPENSEARCH_USERNAME": "<username>",
      "OPENSEARCH_PASSWORD": "<password>",
      "OPENSEARCH_SSL_VERIFY": "false",
      "FASTMCP_LOG_LEVEL": "ERROR"
    }
  }
}

For Amazon OpenSearch Service (AOS) — User Guide:

{
  "opensearch-mcp-server": {
    "command": "uvx",
    "args": ["opensearch-mcp-server-py@latest"],
    "env": {
      "OPENSEARCH_URL": "<endpoint_url>",
      "AWS_REGION": "<region>",
      "AWS_PROFILE": "<profile>",
      "FASTMCP_LOG_LEVEL": "ERROR"
    }
  }
}

For Amazon OpenSearch Serverless (AOSS) — User Guide:

{
  "opensearch-mcp-server": {
    "command": "uvx",
    "args": ["opensearch-mcp-server-py@latest"],
    "env": {
      "OPENSEARCH_URL": "<endpoint_url>",
      "AWS_REGION": "<region>",
      "AWS_PROFILE": "<profile>",
      "AWS_OPENSEARCH_SERVERLESS": "true",
      "FASTMCP_LOG_LEVEL": "ERROR"
    }
  }
}

Key Rules

Workflow

Phase 1 — Connect to Cluster

Before doing anything else, ask the user which cluster to connect to. Do not assume localhost or any default:

Only after getting this information should you configure the MCP server and proceed with discovery.

Phase 2 — Discover Indices

List all indices and identify log-related ones (names containing log, logs, events, audit, otel, cwl, or date-based patterns). Check for data streams and aliases.

Phase 3 — Understand Schema

Inspect the target index mapping. Identify key fields:

  1. Timestamp@timestamp, timestamp, time
  2. Log levellevel, log.level, severityText
  3. Messagemessage, body, msg
  4. Service/sourceservice.name, host.name, kubernetes.pod.name
  5. Error fieldserror.message, error.stack_trace
  6. CorrelationtraceId, spanId, request_id

Sample a few documents to confirm which fields are actually populated.

Phase 4 — Analyze

Build PPL queries using the actual field names discovered. Common analytics:

Phase 5 — Advanced Analysis

Reference Files

File Content
log-analytics.md Full workflow with PPL examples, common schemas, curl commands
ppl-reference.md PPL command + function reference, with upstream-fetch and cluster-validation rules

Skill frontmatter

compatibility: Requires a running OpenSearch cluster. PPL queries require the SQL plugin (built-in). metadata: {"author" => "opensearch-project", "version" => "2.0"}

Work with this as data

Every skill here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for agent skills

4 MCP tools reach this
  • find_skillsBrowse and filter every skill in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This skill
curl "https://apis.io/api/v1/skills/log-analytics"
All agent skills
curl "https://apis.io/api/v1/skills?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.