Custom Log Formats
Not every log is the same...
Using Built-in Formats
# Download and install format
mkdir -p ~/.config/gonzo/formats
cp <format-file>.yaml ~/.config/gonzo/formats/
# Use the format
gonzo --format=loki-stream -f logs.json
# List available formats
ls ~/.config/gonzo/formats/Creating Your Own Custom Formats
Quick Start
1. Create a Format File
2. Define Your Format
3. Use the Format
Basic Structure
Format Types
Common Regex Patterns
Pattern
Description
Example
Time Formats
Format
Example
Description
Field Transforms
Complete Examples
Example 1: Node.js Application Logs
Example 2: Kubernetes/Docker JSON Logs
Example 3: Apache Access Logs
Advanced Features
Batch Processing
Nested JSON Fields
Pattern Extraction
Conditional Defaults
HTTP Status Code to Severity Mapping
Multiple Pattern Matching
Testing & Troubleshooting
Best Practices
Additional Resources
Last updated