Skip to content

feat(audit-logs): export filtered logs as CSV, TSV or JSON - #5797

Merged
imrja8 merged 2 commits into
Dokploy:canaryfrom
imrja8:feat/audit-logs-export
Oct 28, 2026
Merged

imrja8 merged 2 commits into
Dokploy:canaryfrom
imrja8:feat/audit-logs-export

Conversation

@imrja8

@imrja8 imrja8 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

What is this PR about?

Adds an Export dropdown next to Columns on Settings → Audit Logs. It exports every entry matching the current filters (user, name, action, resource, date range) as CSV, TSV or JSON, not just the visible page. With no filters, everything is exported. The menu shows how many entries will be exported and whether the current filters apply.

  • API: new auditLog.export query with the same auditLog:read permission and license check as auditLog.all. Both procedures now share one filter schema and one licensed procedure, so they can't drift apart.
  • Limit: the newest 10,000 entries per export. If more match, a warning toast says how many were exported and suggests narrowing the filters.
  • CSV/TSV: quoted where needed, with a UTF-8 BOM so Excel reads non-ASCII text correctly. User-entered fields that start with =, +, - or @ get a leading ' so spreadsheet apps don't run them as formulas (CSV injection).
  • JSON: each entry's metadata is parsed into an object instead of a string.

The date filter fix is a separate PR. The two touch different lines and merge cleanly in either order.

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Issues related (if applicable)

closes #5795

Screenshots (if applicable)

Audit Logs page with the Export menu open
  1. Export button, next to Columns.
  2. Export menu: how many entries will be exported, whether filters apply, and the CSV, TSV and JSON options.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Adds CSV, TSV, and JSON exports for filtered audit logs, capped at the newest 10,000 entries.

  • The audit-log API now provides a capped export query alongside the paged list.
  • Audit Logs downloads filtered entries in CSV, TSV, or JSON.

Reviews (2) · Last reviewed commit: "fix(audit-logs): show the capped count i..." · Reviewed by Greptile

@imrja8
imrja8 requested a review from Siumauricio as a code owner October 27, 2026 06:24
@imrja8
imrja8 merged commit 942fd61 into Dokploy:canary Oct 28, 2026
5 checks passed
@imrja8
imrja8 deleted the feat/audit-logs-export branch November 3, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit logs: export filtered logs as CSV, TSV or JSON

2 participants