Gonzo supports custom log formats through YAML configuration files, allowing you to parse logs from any application and convert them to OpenTelemetry (OTLP) attributes for analysis.
loki-batch.yaml - Loki batch format with multi-entry expansion
vercel-stream.yaml - Vercel logs
nodejs.yaml - Node.js application logs
apache-combined.yaml - Apache/Nginx access logs
Setup:
# Download and install formatmkdir-p~/.config/gonzo/formatscp<format-file>.yaml~/.config/gonzo/formats/# Use the formatgonzo--format=loki-stream-flogs.json# List available formatsls~/.config/gonzo/formats/
Examples:
Creating Your Own Custom Formats
Quick Start
1. Create a Format File
Create a YAML file in ~/.config/gonzo/formats/ directory:
2. Define Your Format
3. Use the Format
Basic Structure
Format Types
text - Plain text logs with regex patterns:
json - JSON structured logs:
structured - Fixed position logs (Apache-style):
Common Regex Patterns
Pattern
Description
Example
[\d\-T:\.]+
ISO timestamp
2024-01-15T10:30:45.123
\w+
Word characters
ERROR, INFO
\d+
Digits
12345
[^\]]+
Everything except ]
Content inside brackets
.*
Any characters
Rest of line
\S+
Non-whitespace
Token or word
Time Formats
Format
Example
Description
rfc3339
2024-01-15T10:30:45Z
ISO 8601
unix
1705316445
Unix seconds
unix_ms
1705316445123
Unix milliseconds
unix_ns
1705316445123456789
Unix nanoseconds
auto
Various
Auto-detect format
"2006-01-02 15:04:05"
2024-01-15 10:30:45
Custom Go format
Field Transforms
uppercase: Convert to uppercase (info → INFO)
lowercase: Convert to lowercase (ERROR → error)
trim: Remove whitespace (" text " → "text")
status_to_severity: HTTP status to severity (200→INFO, 404→WARN, 500→ERROR)