Skip to content

hourctl: watching

Read stored events, post events as another system does, read failed device messages, set the log level, read the device messages an instance has in hand, and watch what happens on every instance, live.

Every hourctl command also takes the connection options.

hourctl events

Read stored events, oldest first.

Prints at most 100 events, from the oldest the gateway keeps (or after —after), one per line: sequence number, when it was received, type, endpoint/device and its data. With —follow it reads on from there and prints new events as they are stored, until Ctrl-C. With —json it prints the API’s page (events and next, the —after for the next page), or with —follow one event per line.

hourctl events [OPTIONS]

Options:

  • --after <SEQ>: Only events after this sequence number. Pass the last number a page showed to read the next page.
  • --since <TIME>: Only events received at or after this time: RFC 3339 (2026-10-04T08:00:00Z), or a while ago (90s, 15m, 2h, 7d).
  • --until <TIME>: Only events received before this time, given as —since takes it. Must be later than —since.
  • -f, --follow: Keep reading: poll for new events every 2 seconds until Ctrl-C.
  • --type <TYPE>: Only events of this type, e.g. punch.
  • --device <DEVICE>: Only events from this device (its serial number).
  • --endpoint <ENDPOINT>: Only events from this endpoint (its id).
  • --source <SOURCE>: Only the events the system SOURCE posted into the tenant (hourctl event post), e.g. hr: those of the endpoint source:SOURCE.
  • --user-id <USER_ID>: Only events that name this person (the user_id in their data). It is looked for in every event the other filters leave, so bound it with —since or —device on a large store.

Examples:

Terminal window
hourctl events --since 2h --type punch
hourctl events --device CG0001 --follow

hourctl event

Post events into the tenant’s event log, as another system does.

The events are kept as the tenant’s, and sent to the sinks that name their source in sources and to the install-level sinks.

hourctl event [OPTIONS] <COMMAND>

Commands:

  • post: Post events into the tenant (POST /api/tenants/{tenant}/events): all of them, or none.

hourctl event post

Post events into the tenant (POST /api/tenants/{tenant}/events): all of them, or none.

Each event names its source (the system that sends it), its id (one its source gives no other event), its type, optionally its device (what it is about) and its data (a JSON object of at most 16 KiB); 1 to 100 in one post. Posted again with the same source and id, an event is kept once. Prints how many were stored and which were posted before.

hourctl event post [OPTIONS] <EVENTS>

Arguments:

  • <EVENTS>: The events: a JSON list, {"events": [...]} or one event; the JSON itself, @FILE to read it from a file, or - to read it from stdin.

Options:

  • --source <SOURCE>: The source of the events that name none, e.g. hr.

Examples:

Terminal window
hourctl event post @hires.json --source hr
hourctl event post '{"id": "h-1", "type": "employee.hired", "data": {"person": "104552"}}' --source hr

hourctl failures

List device messages that failed, newest first.

A message fails when its package fails, no route matches it, or what it changed cannot be stored. Prints when, the device, the kind of failure, the route (or the request), where in the package, and the error; never what the message carried. Instances write their failures every 30 seconds or so, and they are kept for retention_days.

hourctl failures [OPTIONS]

Options:

  • --device <DEVICE>: Only this device’s failures (its serial number).
  • --endpoint <ENDPOINT>: Only this endpoint’s failures (its id).
  • --since <TIME>: Only failures at or after this time: RFC 3339 (2026-10-04T08:00:00Z), or a while ago (90s, 15m, 2h, 7d).
  • --limit <N>: At most this many; the gateway gives at most 1000. Default: 100.

Example:

Terminal window
hourctl failures --endpoint office --since 1d

hourctl logs

Show the log level, or change it on every instance.

Without a subcommand, prints the level and the format the instance that answered writes its log in (text at a terminal, else JSON).

hourctl logs [OPTIONS] [COMMAND]

Example:

Terminal window
hourctl logs

Commands:

  • level: Set the log level on every instance, and print it.

hourctl logs level

Set the log level on every instance, and print it.

hourctl logs level [OPTIONS] <FILTER>

Arguments:

  • <FILTER>: The log filter: a level (error, warn, info, debug, trace or off), or a level with per-module levels, e.g. info,houradvantage=debug.

Examples:

Terminal window
hourctl logs level debug
hourctl logs level info,houradvantage=debug

hourctl wire

Watch every byte devices send and receive, on every instance, live.

Shows each request and answer as it is, device keys, PINs and templates included, one line per record with the instance that handled it. It runs until —for is up, 64 MiB have been shown, or Ctrl-C. Nothing of it is stored or logged. A file —save writes holds what the devices sent (serials, keys, PINs, cards): on Unix it is readable by its owner alone (mode 0600).

hourctl wire [OPTIONS]

Options:

  • --device <DEVICE>: Only the requests that name this device (its serial number), and their answers.
  • --endpoint <ENDPOINT>: Only the requests for this endpoint (its id), and their answers.
  • --for <DURATION>: For how long: seconds, or a number with s, m or h (90s, 15m, 2h). At most 2h. Default: 15m.
  • --save <FILE>: Also write the exchanges to FILE as a capture for hourctl pkg replay, each as it completes. HTTP listeners only. The file is for one endpoint, the first an exchange is for; exchanges of other endpoints are skipped.
  • --hex: Show each record’s bytes as a hex dump (offset, hex, ASCII) instead of as text.

Examples:

Terminal window
hourctl wire --device CG0001 --for 30m
hourctl wire --endpoint office --save office-capture.toml

hourctl stream

Watch what happens on every instance, live, until Ctrl-C.

Prints a line for each device message, stored event, device change and command, with the instance it happened on.

hourctl stream [OPTIONS]

Example:

Terminal window
hourctl stream

hourctl requests

List the device messages the instance that answers is handling now, and what each is doing.

Prints, oldest first, the endpoint, the device, the route the package chose, the phase it is in (pool_wait, mailbox_wait, package_run, store_writes …) and how long it has been in hand. A message that stays here has something it waits for; this says what. Each instance has its own: ask the one you mean. All are listed.

hourctl requests [OPTIONS]

Example:

Terminal window
hourctl requests