How to change time format of the audit log in Bitbucket Server
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 format in Bitbucket Server and Data Center 7 and newer is hardcoded internally and cannot be changed. By default the timestamp in audit log is in Unix format.
Solution
Environment
Bitbucket Server and Data Center version 7 and newer
Workaround
As a workaround, to change the timestamp from UNIX format to RFC-2822 (for example), you can use the following command:
1
awk -F'|' '{ print $1,"|",$2,"|",$3,"|",strftime("%c", $4),"|",$5,"|",$6,"|",$7,"|",$8; }' < atlassian-bitbucket-audit.log > atlassian-bitbucket-audit.log.date
Was this helpful?