How to query audit log settings in Bitbucket Datacenter?
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
The audit log settings page can be accessed from Bitbucket UI by Navigating to Bitbucket admin page → Audit log → Click on the 3 dots on the right-hand top and click on settings.
To retrieve the values set in the audit logs settings page, please run the database query in the solution section.
Environment
7.X, 8.X
Solution
Audit log settings details are stored in the plugin_setting table, run the below query to find these details in the database.
select * from plugin_setting where key_name like '%com.atlassian.audit.plugin:audit-config%';
"com.atlassian.audit.plugin:audit-config:retention:max:file:count" is equivalent to "Files per node" in the UI under "Audit log file retention"
"com.atlassian.audit.plugin:audit-config:retention:period" is equivalent to the Database retention period. similarly, you can find other Coverage areas with their Coverage levels.
Note : Database has a hard limit and can store a max of 10,000,000 records irrespective of the number of years set for the database retention period, this limit is in place to stop flooding the database and avoid performance issues, hence the audit logs are also stored in the file system in JSON format, by default 100 files are stored in the file system which is configurable, you can increase this by setting "Number of files stored" option in Audit log settings page.