Skip to content

ts audit

Query the audit log — the record of operator actions such as changing a setting, creating a user, rotating a key, or publishing a policy.

Usage

text
ts audit [-n=N] [--since=DATE] [--until=DATE] [--event=TYPE] [--csv] [--no-trunc]

Description

Entries are returned newest first. Each records when it happened, who did it and from what address, what was affected, and any details specific to that kind of event.

When more entries match than were returned, ts audit says so, so a truncated window is never mistaken for a quiet one. Narrow with --since/--until or raise -n.

--event filters to a single event type, named as the server names it — GlobalSettingChanged, UserDeleted, SigningKeyRotated, PolicyPublished, CliLoginApproved, and so on. An unknown name is rejected with an error rather than silently matching nothing.

Entries with no user are system-initiated and show as system.

Options

FlagDescriptionDefault/ValuesNotes
-n, --numberMaximum entries to return.Default 100; max 2000
--sinceWindow start.ISO-8601E.g. 2026-07-01 or 2026-07-01T09:00:00Z.
--untilWindow end.ISO-8601
--eventReturn only this event type.Rejected if not a known type.
--csvTab-separated output, nothing truncated.For spreadsheets and pipes.
--no-truncDo not truncate columns.

Examples

bash
# The last few things anyone did
ts audit -n=20

# One day
ts audit --since=2026-07-29 --until=2026-07-30

# Every settings change this month
ts audit --since=2026-07-01 --event=GlobalSettingChanged

# Who has been approving command-line sign-ins
ts audit --event=CliLoginApproved -n=200

# Export for review
ts audit --since=2026-01-01 -n=2000 --csv > audit.tsv

Output

text
TIME                         USER    EVENT                   TARGET       DETAILS                    IP
2026-07-29T18:15:38.309Z     alice   Notification deleted    Maintenance                             10.2.0.9
2026-07-29T17:58:00.174Z     alice   Server setting changed  node-1       key=SslHsts; from=(unset)  10.2.0.9
Showing 2 of 19 entries; narrow the window or raise -n.

Exit Codes

0 on success, including when nothing matches. -1 when a date or event type cannot be parsed. -5 when the account is not a Server Administrator.

  • ts report — Session, usage, and share reports as CSV or PDF.
  • ts settings — Change the settings whose history appears here.