| Description |
This article provides detailed steps for exporting audit logs stored in the PostgreSQL database to a CSV file for backup, review, or analysis purposes. |
| Scope | FortiSOAR. |
| Solution |
To export audit logs from the backend, execute the following command as the root user:
env PGPASSWORD=$(csadm license --get-device-uuid) psql -U cyberpgsql -d gateway -c "\COPY auditlogs TO '/tmp/auditlogs.csv' CSV HEADER"
Explanation:
Notes:
Example (Custom Output Path):
env PGPASSWORD=$(csadm license --get-device-uuid) psql -U cyberpgsql -d gateway -c "\COPY auditlogs TO '/tmp/auditlogs_$(date +%F).csv' CSV HEADER" This creates a dated CSV file in a custom export folder. |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.