maton trigger event watch
maton trigger event watch --trigger <trigger-id> [flags]
Print each new event a trigger receives, starting from now, until interrupted with Ctrl-C.
With –json the stream emits newline-delimited JSON (one object per line) for piping into jq or a shell loop.
With –exec the given command runs once per event via “sh -c”, with the event JSON on stdin and its ID in MATON_EVENT_ID. The last processed event ID is checkpointed per trigger, so restarting resumes after it and an interrupted batch never re-runs handled events.
Options
-
--exec <string> - Run a shell command for each new event (event JSON on stdin)
-
--exit-status - Exit non-zero on a poll error instead of logging and continuing
-
--interval <duration> (default "2s") - Polling interval
-q,--jq <expression>- Filter JSON output using a jq expression
-
--json <fields> - Output JSON with the specified fields
-
--template <string> - Format JSON output using a Go template; see "maton help formatting"
-t,--trigger <string>- Trigger ID this resource belongs to (required)
Options inherited from parent commands
-p,--profile <string>- Profile to use for this invocation (overrides the active profile; also reads MATON_PROFILE)
JSON Fields
delivery_counts, event_id, payload, received_at
Examples
$ maton trigger event watch --trigger trg_abc123
$ maton trigger event watch -t trg_abc123 --exec ./handle.sh
$ maton trigger event watch -t trg_abc123 --json | jq .payload