Reading archives: archived entries¶
Once retention has archived and live-purged a range, its rows are no longer on the entries page: they are in an archive file. Opening archive files puts their rows on the Archived entries page, to be read and searched again with the same filters as the live entries.
drush audit_trail:archive-open /mnt/worm/webdav/2025-*.ndjson
Then open Reports > Audit trail > Archived entries.
What it is for¶
Reading. A complaint about a document edited last year, an audit that needs every login of a user over three years, a search across the archives of a chain that was cleared or rebuilt since: open the files, search, close them.
It works on any archive written by the archive stage:
- of the chain as it is, or of one that started again since, a chain cleared or a database rebuilt;
- of any chain on the site, or of another site;
- several at once: one search runs across every file open.
What it is not¶
The rows are a copy to read, kept in a table of their own,
audit_trail_archived. They are not put back into the audit trail:
- they are checked only against their own file (see Searching
below). To check a file, footer included, use
drush audit_trail:archive-verify --path=<file>; - they are not part of any chain, so the page says nothing about whether they verify, and shows no chain neighbors;
- retention never touches them, and they never touch the live entries.
To put a range's rows back into the chain they came from, use a
restore instead (drush audit_trail:archive-restore). That only
works for the chain as it is: once a chain has started again, its
ids belong to its new rows.
Opening archives¶
From the command line, any number of files, so a shell glob opens a whole directory:
# Every 2025 archive of the webdav chain.
drush audit_trail:archive-open /mnt/worm/webdav/2025-*.ndjson
# Two files from another site.
drush audit_trail:archive-open /tmp/old-site/members-11.ndjson /tmp/old-site/members-12.ndjson
From the admin pages:
- Archived entries > Open archives uploads one or more files;
- Segments, on an archived segment: Open in archived entries opens its archive file from the archive directory.
Each open archive is known by its path from the command line, its file name when uploaded, or for a segment by its id, chain and range. An archive already open under that name is refused rather than opened twice.
Opening needs the administer audit trail permission. Reading the view needs view audit trail reports, as the entries do.
Searching¶
The Archived entries tab lists the open archives and their rows, with the entries page's filters: chain, channel, action, resource, severity, user, date range, message, client IP, request URI, correlation and trace ids. The Archive column says which file a row came from, and a row's id is the one it had in its chain.
Each row has a dot right after its id, set when its file was opened, from what the file says of it:
- red, broken: the row does not hash to what it carries, its signature or its transient context does not check, it does not link to the row before it in the file, or the archive stage found it broken when it wrote the file;
- gray, unchecked: this site does not have the secret it was signed under, as for any archive of another site, or cannot read its Key right now;
- green, sound: none of that.
The dot's tooltip, and the row's own page, say why. The Check filter lists the broken or unchecked rows alone:
/admin/reports/audit-trail/archived?verdict=broken
That is what the file says of its own rows, not a verification of
any chain: a row sound in its file says nothing of the chain it
came from. To check a file against itself, footer included, use
drush audit_trail:archive-verify --path=<file>.
A row's detail page shows what the row says, as for a live entry: its payload, its audit event and its context, with its Check.
The user is shown by id, not by name: an archive of another chain or another site carries ids that name other people than this site's accounts.
Rows whose transient context was purged before the archive show "(purged)" for the message, the user, the IP and the request URI, as on the entries page.
Closing archives¶
# Everything open.
drush audit_trail:archive-close
# One archive, by the name it is open under.
drush audit_trail:archive-close --source=2025-03.ndjson
Or Archived entries > Close archives. The rows are dropped from the page; the archive files and the audit trail are not touched, and the files can be opened again.
The page holds what was opened until it is closed, so close it once you are done: its rows include the archived personal data.