elasticsearch-logs

Search and aggregate logs in an existing Elasticsearch cluster using Query DSL and ESQL.

650|182|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/automateyournetwork/netclaw --skill elasticsearch-logs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elasticsearch-logs
Source: https://github.com/automateyournetwork/netclaw/tree/main/workspace/skills/elasticsearch-logs
Command: npx skills add https://github.com/automateyournetwork/netclaw --skill elasticsearch-logs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Answering log questions against Elasticsearch is error-prone: a bare search silently caps totals at 10,000, guessed field names return empty results, and an empty result looks identical to an absence of events. This Skill enforces correct counting via ESQL or track_total_hits and mapping-first querying so reported numbers are accurate.

Core Features & Use Cases

  • Accurate Counting: Uses ESQL STATS COUNT(*) or search with track_total_hits so totals above 10,000 are reported correctly instead of silently truncated.
  • Read-Only Log Search: Lists indices, inspects field mappings, retrieves matching documents, and checks shard health across syslog, Zeek/Suricata, or application log indices.
  • Backend Routing Guidance: Distinguishes Elasticsearch from Splunk, Datadog, GCP Cloud Logging, and Prometheus so queries go to the store that actually holds the data.
  • Use Case: Ask "how many errors did each device log last week" and get an exact per-device count from your syslog index, then retrieve example error documents for investigation.

Quick Start

Ask the agent to count errors by device in your Elasticsearch syslog index and show example matching log entries.

Frequently Asked Questions about elasticsearch-logs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I count documents in Elasticsearch accurately?

Use an ESQL query with STATS COUNT(*) or a search request with track_total_hits set to true. A bare search caps the reported total at 10,000 and drops the qualifier, so the number can be arbitrarily wrong on large indices.

How do I search Elasticsearch logs by device or severity?

First run get_mappings on the index to learn real field names, then use a search with a term query, for example severity equals error. Use the .keyword sub-field for exact matches, grouping, and sorting rather than the analysed text field.

Why does my Elasticsearch query return no results?

Empty results usually come from guessed field names, querying a text field instead of its .keyword variant, or a time range that does not match how data is timestamped. Verify the index holds data with list_indices and confirm fields with get_mappings before concluding no events occurred.

Can this skill write or delete data in Elasticsearch?

No. All five tools are read-only: list_indices, get_mappings, search, esql, and get_shards. There is no index, update, or delete verb, and a read-only API key with view_index_metadata is sufficient.

When should I use Elasticsearch versus Splunk or Datadog for logs?

Choose based on where the logs actually live: this skill for Elasticsearch/ELK indices, splunk-search for Splunk, and datadog-logs for Datadog. Querying the wrong backend returns empty results that are indistinguishable from an absence of events.