home/versioned_docs/version-1.8.0/help/log_integration.md
HertzBeat's log integration module aims to achieve unified reception, standardized processing of log data from different third-party log systems and observability platforms. As a centralized "log center", HertzBeat can efficiently integrate log information from external systems and provide real-time log monitoring and analysis capabilities.
:::warning The log integration feature is currently in Beta (experimental) stage. There may be potential defects and limitations. The feature is under active development and iteration. :::
HertzBeat currently supports data integration from the following third-party log platforms:
You can view specific integration methods and configuration examples through HertzBeat's "Log Integration" interface.
HertzBeat provides the following interface for receiving OTLP log data:
POST /api/logs/otlp/v1/logs
Content-Type: application/json or application/x-protobufAuthorization: Bearer {token}Supports standard OTLP JSON-Protobuf format or Binary Protobuf format log data:
{
"resourceLogs": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "my-service"
}
},
{
"key": "service.version",
"value": {
"stringValue": "1.0.0"
}
}
]
},
"scopeLogs": [
{
"scope": {
"name": "my-logger",
"version": "1.0.0"
},
"logRecords": [
{
"timeUnixNano": "1640995200000000000",
"severityNumber": 9,
"severityText": "INFO",
"body": {
"stringValue": "This is a log message"
},
"attributes": [
{
"key": "user.id",
"value": {
"stringValue": "12345"
}
}
],
"traceId": "12345678901234567890123456789012",
"spanId": "1234567890123456"
}
]
}
]
}
]
}
Add HertzBeat as a log export target in the OpenTelemetry Collector configuration file:
exporters:
otlphttp:
logs_endpoint: http://{hertzbeat_host}:1157/api/logs/otlp/v1/logs
compression: none
encoding: json
headers:
Authorization: "Bearer {token}"
service:
pipelines:
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp]
Application and environment information can be set through resource.attributes:
service.name: Service nameservice.version: Service versiondeployment.environment: Deployment environment (dev/test/prod)host.name: Host nameapplication/jsonFor more log integration methods or technical issues, feel free to communicate with the community through GitHub Issues.