count
Determine the number of documents in an OpenSearch index or pattern, optionally filtered by a query to narrow the count to specific records.
Instructions
Count documents in an index, optionally filtered by a query.
Args: index: Index name or pattern (e.g. 'logs-*'). query_body: Optional JSON string with a query filter (e.g. '{"query": {"match": {"level": "ERROR"}}}').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | ||
| query_body | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |