stack es helpers watch cli command
Auth required
Idempotent
Scope: global
elastic stack es helpers watch --index <index> [options]
Watch an index for new documents and stream them to stdout as NDJSON.
Behaviour flags:
--dry-run — validate all inputs and exit without performing any action
--indexstringrequired- Index or data stream to watch
--querystring- Query DSL clause as JSON (wrapped under "query"), e.g. '{"match":{"log.level":"error"}}'
--query-filestring- Path to a file containing the full search body JSON
--sort-fieldstring-
Field to use for ordering and detecting new documents
Default:
@timestamp --poll-intervalnumber-
Polling interval in milliseconds
Default:
5000 --fromstring- ISO 8601 timestamp to start from (e.g. "2024-01-01T00:00:00Z"). Defaults to the most recent document.
--sizenumber-
Maximum documents to fetch per poll
Default:
100 --formatstring- Output template with {field} placeholders, e.g. "{@timestamp} {message}". Omit for NDJSON (_source as JSON).
--input-filestring- path to a JSON file to use as command input
--dry-run- validate all inputs and exit without performing any action (preview changes without applying them)
--no-validate- skip input validation and send the request as-is
--output-fieldsstring- comma-separated list of fields to include in output (dot-notation supported)
--output-templatestring- Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
--json-
output as JSON