👁️

Count Logs By Level

Verified

@elastic/count-logs-by-level

Count logs grouped by severity level

Usage

RUN SKILL count_logs_by_level()

With parameters:

RUN SKILL count_logs_by_level WITH index_pattern = 'value', time_range = 'value'

Parameters

NameTypeDefaultDescription
index_patternSTRINGIndex pattern to search (e.g., logs-*, logs-production-*)
time_rangeSTRINGTime range to analyze (e.g., 1h, 24h, 7d)

Returns

ARRAY— An array of matching documents

Example

-- Using curl
curl -u elastic-admin:elastic-password http://localhost:9200/_escript \
  -H "Content-Type: application/json" \
  -d '{"query": "RUN SKILL count_logs_by_level()"}'

-- Response
{
  "result": [...],
  "_meta": {
    "execution_id": "abc123",
    "duration_ms": 45
  }
}