Gonzo now supports streaming logs directly from Victoria Logs with custom field parsing that properly maps Victoria Logs format to the internal OTLP format.
_msg: Mapped to the log body (displayed as the main message instead of raw JSON)_time: Parsed as the log timestamp- All other fields: Automatically mapped to attributes
The following fields are checked in order and mapped to the host attribute:
k8s.node.namekubernetes.pod_node_namekubernetes_pod_node_name
The following fields are checked for severity levels:
levelseveritylog.levellog_levelloglevellevelname
--vmlogs-url Victoria Logs URL endpoint (e.g., http://localhost:9428)
--vmlogs-user Basic auth username
--vmlogs-password Basic auth password
--vmlogs-query LogsQL query (default: "*")export GONZO_VMLOGS_URL="http://localhost:9428"
export GONZO_VMLOGS_USER="myuser"
export GONZO_VMLOGS_PASSWORD="mypass"
export GONZO_VMLOGS_QUERY="service:'my-app'"vmlogs-url: "http://localhost:9428"
vmlogs-user: "myuser"
vmlogs-password: "mypass"
vmlogs-query: "*"gonzo --vmlogs-url="http://localhost:9428" --vmlogs-query="*"gonzo --vmlogs-url="https://vmlogs.example.com" \
--vmlogs-user="myuser" \
--vmlogs-password="mypass" \
--vmlogs-query='level:error'gonzo --vmlogs-url="http://localhost:9428" \
--vmlogs-query='service:"payment-processor" AND level:error'export GONZO_VMLOGS_USER="myuser"
export GONZO_VMLOGS_PASSWORD="mypass"
gonzo --vmlogs-url="https://vmlogs.example.com" \
--vmlogs-query='k8s.node.name:"node-01"'Input from Victoria Logs:
{
"_msg": "Database connection established",
"_stream": "app-logs",
"_stream_id": "stream-001",
"_time": "2024-01-15T10:30:46.456Z",
"level": "INFO",
"k8s.node.name": "node-02",
"service": "database",
"pool_size": 10
}This will be displayed in Gonzo as:
- Message: "Database connection established" (not the raw JSON)
- Severity: INFO (with appropriate color coding)
- Host: node-02 (mapped from k8s.node.name)
- Attributes: service, pool_size, etc..
The Victoria Logs client (internal/vmlogs/client.go) includes:
- Streaming client that connects to Victoria Logs
/select/logsql/tailendpoint - Format converter that transforms Victoria Logs JSON to OTLP format
- Field mapper that handles special fields and attributes
- Severity detector that identifies log levels from various field names