Skip to content

Commit cff2333

Browse files
update audit log export
1 parent a2ae075 commit cff2333

File tree

1 file changed

+69
-4
lines changed

1 file changed

+69
-4
lines changed

docs/security/audit-log.mdx

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,78 @@ You can also export the audit logs.
2828

2929
![filter-date](/content/docs/security/audit-log/filter-date.webp)
3030

31-
## Emit audit logs to stdout
31+
## Stream audit logs to external systems
3232

33-
Bytebase can emit audit logs to **stdout**, allowing seamless integration with log aggregation and SIEM systems such as Datadog, Splunk, Elastic, Loki, CloudWatch, and GCP Logging—without using the API.
33+
Bytebase can stream audit logs to **stdout** for collection by external logging and monitoring systems.
3434

35-
Go to **Settings** -> **General** -> **Audit Log Export**, and enable **Enable audit logging to stdout**.
35+
### Configuration
3636

37-
Once enabled, audit events will appear in the standard output stream of your Bytebase service.
37+
1. Navigate to **Settings****General****Audit Log Export**.
38+
2. Enable **Enable audit logging to stdout**.
39+
40+
Once enabled, audit events stream to the standard output of your Bytebase service.
41+
42+
### Output format
43+
44+
By default, audit logs are output as key-value pairs. To enable JSON format for easier parsing by log aggregators, start Bytebase with one of these flags:
45+
46+
- `--enable-json-logging` - Outputs all logs in JSON format (you still need to enable the audit log export in the settings)
47+
48+
**Docker example with JSON format:**
49+
```bash
50+
docker run -d \
51+
--name bytebase \
52+
bytebase/bytebase:latest \
53+
--enable-json-logging \
54+
--port 8080 \
55+
--data /var/opt/bytebase
56+
```
57+
58+
### Example output
59+
60+
**Default format (key-value pairs):**
61+
```
62+
time=2025-12-10T15:55:21.729Z level=INFO source=v1/audit.go:274
63+
msg=/bytebase.v1.ProjectService/SetIamPolicy log_type=audit
64+
parent=projects/project-sample method=/bytebase.v1.ProjectService/SetIamPolicy
65+
resource=projects/project-sample user=users/101 latency_ms=7
66+
client_ip=192.168.65.1:51907 user_agent="Mozilla/5.0..." severity=INFO
67+
```
68+
69+
**With JSON format enabled:**
70+
```json
71+
{
72+
"time": "2025-12-10T15:55:21.729Z",
73+
"level": "INFO",
74+
"source": "v1/audit.go:274",
75+
"msg": "/bytebase.v1.ProjectService/SetIamPolicy",
76+
"log_type": "audit",
77+
"parent": "projects/project-sample",
78+
"method": "/bytebase.v1.ProjectService/SetIamPolicy",
79+
"resource": "projects/project-sample",
80+
"user": "users/101",
81+
"latency_ms": 7,
82+
"client_ip": "192.168.65.1:51907",
83+
"user_agent": "Mozilla/5.0...",
84+
"severity": "INFO"
85+
}
86+
```
87+
88+
### Integration
89+
90+
When running Bytebase in Docker or Kubernetes, audit logs automatically appear in container logs and can be collected by your existing logging infrastructure:
91+
92+
- **Docker**: Access via `docker logs` or configure Docker logging drivers
93+
- **Kubernetes**: Collected by cluster logging systems (Fluentd, Fluent Bit)
94+
- **Cloud platforms**: Stream to CloudWatch (AWS), Cloud Logging (GCP), or Azure Monitor
95+
96+
### Supported systems
97+
98+
The stdout logs can be ingested by any log collection system, including:
99+
100+
- **SIEM platforms**: Splunk, Datadog, Elastic, Sumo Logic, Panther
101+
- **Log aggregators**: Fluentd, Logstash, Vector, Loki
102+
- **Cloud logging**: AWS CloudWatch, GCP Logging, Azure Monitor
38103

39104
## Retention
40105

0 commit comments

Comments
 (0)