Skip to content

Add date range filtering and CSV export to audit log UI - #4

Merged
sagnik11 merged 1 commit into
mainfrom
feat/implement-append-only-audit-log-system
May 4, 2026
Merged

Add date range filtering and CSV export to audit log UI#4
sagnik11 merged 1 commit into
mainfrom
feat/implement-append-only-audit-log-system

Conversation

@sagnik11

@sagnik11 sagnik11 commented May 4, 2026

Copy link
Copy Markdown
Member

TL;DR

Add date range filtering (from/to dates) and CSV export functionality to the audit log dashboard, along with environment variables for controlling export limits and data retention policies.

What changed?

  • Environment configuration: Added AUDIT_LOG_RETENTION_DAYS and AUDIT_LOG_EXPORT_MAX_ROWS environment variables to .env.example with documentation
  • UI filters: Added "From" and "To" date input fields to allow filtering audit logs by date range
  • Export functionality: Added "Export CSV" button that downloads filtered audit logs as CSV
  • API enhancements:
    • Extracted filter parsing into reusable parseFilters() function
    • Implemented CSV export endpoint with row cap validation (prevents exports exceeding AUDIT_LOG_EXPORT_MAX_ROWS)
    • Added CSV formatting with proper escaping for special characters
    • Returns error if export would exceed configured limit, prompting user to narrow date range
  • State management: Added fromDate and toDate state variables, integrated into filter dependencies and reset logic
  • UI layout: Restructured header to include both title/description and export button side-by-side

… filtering

Generated-By: PostHog Code
Task-Id: 724f7f1d-c542-4cce-9332-eda23b8b7849
@sagnik11
sagnik11 marked this pull request as ready for review May 4, 2026 05:24
@sagnik11
sagnik11 merged commit 001bb0a into main May 4, 2026
1 of 2 checks passed
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.

1 participant