For the complete documentation index, see llms.txt. This page is also available as Markdown.

Log Format Issues

Troubleshooting guide for log parsing and format detection problems in Gonzo.

Format Detection Issues

Logs Not Being Parsed

Symptom: Structured logs appear as plain text instead of being parsed.

Diagnosis:

Gonzo automatically detects formats per line based on these rules:

  • JSON: Lines starting with {

  • Logfmt: Lines containing key=value patterns

  • Plain text: Everything else

Solutions:

  1. Verify JSON is valid

    # Test each line individually
    head -1 logs.json | jq .
    
    # If error, JSON is malformed
  2. Check line starts with {

    # JSON must start with opening brace
    head logs.json
    
    # ✅ Good: {"level":"info"...
    # ❌ Bad: 2024-01-15 {"level":"info"...
  3. Inspect logfmt format

    # Should have key=value pairs
    head logs.txt
    
    # ✅ Good: level=info service=api msg="started"
    # ❌ Bad: [INFO] service api started
  4. Use custom format for non-standard logs

    gonzo --format=my-custom-format -f logs.txt

Mixed Format Logs

Symptom: Some lines parse correctly, others don't.

Explanation: Gonzo detects format per line, so mixed formats will have inconsistent parsing.

Example:

Solutions:

  1. Accept mixed display

    • This is expected behavior

    • Each format renders appropriately

  2. Pre-filter to single format

  3. Convert to uniform format

Attributes Not Extracted

Symptom: Logs parse but attributes panel is empty.

Causes & Solutions:

  1. Plain text logs have no structured attributes

    • Plain text can't be parsed into fields

    • Only JSON and logfmt have attributes

  2. Check JSON structure

  3. Nested JSON

    • Gonzo extracts nested attributes

    • May need to check nested paths

  4. Missing common attribute names

    • Gonzo looks for common fields: level, service, host, etc.

    • Custom fields may not be highlighted

JSON Issues

Malformed JSON

Symptom: JSON logs show as plain text or cause errors.

Common JSON Issues:

  1. Trailing commas

  2. Single quotes instead of double

  3. Unescaped quotes in strings

  4. Missing quotes on keys

Validate & Fix:

Multi-line JSON

Symptom: JSON objects span multiple lines, not parsed correctly.

Example:

Solution:

Gonzo expects one JSON object per line (JSONL/NDJSON format).

JSON with Metadata Prefix

Symptom: Lines have timestamp or metadata before JSON.

Example:

Solution:

Remove prefix before piping to Gonzo:

Escaped JSON in Strings

Symptom: JSON contains escaped JSON strings.

Example:

Solution:

Logfmt Issues

Logfmt Not Detected

Symptom: Key=value logs appear as plain text.

Requirements for logfmt detection:

  • Must have key=value patterns

  • Multiple pairs per line

  • Values can be quoted: key="value with spaces"

Example:

Solutions:

  1. Verify format

  2. Add more key=value pairs

    • Single pair may not trigger detection

    • Multiple pairs more reliably detected

  3. Use custom format

Spaces in Logfmt Values

Symptom: Values with spaces not parsed correctly.

Examples:

Solution:

Ensure spaces in values are properly quoted or escaped:

Logfmt with Nested Structures

Symptom: Nested objects in logfmt don't parse well.

Example:

Explanation: Logfmt is flat by design. Nested structures need JSON.

Solution:

  1. Accept flat representation

    • Gonzo extracts user.id and user.name as separate attributes

  2. Convert to JSON if needed

Plain Text Issues

No Structure Extracted from Text Logs

Symptom: Plain text logs show no attributes.

Explanation: Plain text logs can't be parsed into structured fields automatically.

Examples:

Solutions:

  1. Accept plain text display

    • Logs still searchable and analyzable

    • Just no structured attributes

  2. Create custom format parser

  3. Convert logs to structured format

    • Modify application to output JSON/logfmt

    • Use log shipper to add structure (Fluent Bit, Logstash)

Severity Not Detected in Text Logs

Symptom: Plain text logs don't show color-coded severity.

Explanation: Gonzo looks for common severity keywords in text logs:

  • ERROR, FATAL, CRITICAL → Red

  • WARN, WARNING → Yellow

  • INFO → Green

  • DEBUG → Blue

  • TRACE → White

Solutions:

  1. Include severity keywords

  2. Use consistent format

    • Put severity at start of line

    • Use standard keywords (ERROR, WARN, INFO, DEBUG)

  3. Create custom format

    • Define severity extraction pattern

    • Map custom levels to standard severities

OTLP Format Issues

OTLP Logs Not Appearing

Symptom: OTLP receiver running but no logs in Gonzo.

Diagnosis:

  1. Verify receiver is enabled

  2. Check sender configuration

  3. Test with curl (HTTP)

  4. Check for port conflicts

Solutions:

See Common Issues - OTLP Receiver for detailed fixes.

OTLP Attributes Missing

Symptom: OTLP logs appear but without expected attributes.

Causes:

  1. Attributes in resource vs log record

    • Resource attributes: service.name, host, etc.

    • Log record attributes: user_id, request_id, etc.

    • Both should be extracted

  2. Verify sender includes attributes

  3. Check attribute names

    • Gonzo shows all attributes

    • May just be named differently than expected

Custom Format Issues

Custom Format Not Working

Symptom: --format=my-format shows error or doesn't parse.

Diagnosis:

  1. Verify format file exists

  2. Check YAML syntax

  3. Test with built-in format first

Solutions:

See Custom Formats Guide for:

  • Format file syntax

  • Regex patterns

  • Field mapping

  • Testing formats

Regex Not Matching

Symptom: Custom format regex doesn't extract fields.

Solutions:

  1. Test regex separately

  2. Use online regex tester

    • Test at regex101.com

    • Use example log lines

    • Verify capture groups

  3. Check for special characters

  4. Start simple, iterate

Encoding Issues

Special Characters Garbled

Symptom: Non-ASCII characters display incorrectly.

Solutions:

  1. Ensure UTF-8 encoding

  2. Check file encoding

  3. Terminal font support

    • Use font with good Unicode support

    • JetBrains Mono, Fira Code, Cascadia Code

Binary or Non-Text Data

Symptom: Binary data causes display issues.

Solution:

Performance with Complex Formats

Slow Parsing with Complex Regex

Symptom: Custom format with complex regex causes slowdowns.

Solutions:

  1. Simplify regex patterns

  2. Reduce backtracking

    • Avoid nested quantifiers: (.*)*

    • Use possessive quantifiers when possible

    • Anchor patterns: ^ and `# Log Format Issues

Troubleshooting guide for log parsing and format detection problems in Gonzo.

Format Detection Issues

Logs Not Being Parsed

Symptom: Structured logs appear as plain text instead of being parsed.

Diagnosis:

Gonzo automatically detects formats per line based on these rules:

  • JSON: Lines starting with {

  • Logfmt: Lines containing key=value patterns

  • Plain text: Everything else

Solutions:

  1. Verify JSON is valid

  2. Check line starts with {

  3. Inspect logfmt format

  4. Use custom format for non-standard logs

Mixed Format Logs

Symptom: Some lines parse correctly, others don't.

Explanation: Gonzo detects format per line, so mixed formats will have inconsistent parsing.

Example:

Solutions:

  1. Accept mixed display

    • This is expected behavior

    • Each format renders appropriately

  2. Pre-filter to single format

  3. Convert to uniform format

Attributes Not Extracted

Symptom: Logs parse but attributes panel is empty.

Causes & Solutions:

  1. Plain text logs have no structured attributes

    • Plain text can't be parsed into fields

    • Only JSON and logfmt have attributes

  2. Check JSON structure

  3. Nested JSON

    • Gonzo extracts nested attributes

    • May need to check nested paths

  4. Missing common attribute names

    • Gonzo looks for common fields: level, service, host, etc.

    • Custom fields may not be highlighted

JSON Issues

Malformed JSON

Symptom: JSON logs show as plain text or cause errors.

Common JSON Issues:

  1. Trailing commas

  2. Single quotes instead of double

  3. Unescaped quotes in strings

  4. Missing quotes on keys

Validate & Fix:

Multi-line JSON

Symptom: JSON objects span multiple lines, not parsed correctly.

Example:

Solution:

Gonzo expects one JSON object per line (JSONL/NDJSON format).

JSON with Metadata Prefix

Symptom: Lines have timestamp or metadata before JSON.

Example:

Solution:

Remove prefix before piping to Gonzo:

Escaped JSON in Strings

Symptom: JSON contains escaped JSON strings.

Example:

Solution:

Logfmt Issues

Logfmt Not Detected

Symptom: Key=value logs appear as plain text.

Requirements for logfmt detection:

  • Must have key=value patterns

  • Multiple pairs per line

  • Values can be quoted: key="value with spaces"

Example:

Solutions:

  1. Verify format

  2. Add more key=value pairs

    • Single pair may not trigger detection

    • Multiple pairs more reliably detected

  3. Use custom format

Spaces in Logfmt Values

Symptom: Values with spaces not parsed correctly.

Examples:

Solution:

Ensure spaces in values are properly quoted or escaped:

Logfmt with Nested Structures

Symptom: Nested objects in logfmt don't parse well.

Example:

Explanation: Logfmt is flat by design. Nested structures need JSON.

Solution:

  1. Accept flat representation

    • Gonzo extracts user.id and user.name as separate attributes

  2. Convert to JSON if needed

Plain Text Issues

No Structure Extracted from Text Logs

Symptom: Plain text logs show no attributes.

Explanation: Plain text logs can't be parsed into structured fields automatically.

Examples:

Solutions:

  1. Accept plain text display

    • Logs still searchable and analyzable

    • Just no structured attributes

  2. Create custom format parser

  3. Convert logs to structured format

    • Modify application to output JSON/logfmt

    • Use log shipper to add structure (Fluent Bit, Logstash)

Severity Not Detected in Text Logs

Symptom: Plain text logs don't show color-coded severity.

Explanation: Gonzo looks for common severity keywords in text logs:

  • ERROR, FATAL, CRITICAL → Red

  • WARN, WARNING → Yellow

  • INFO → Green

  • DEBUG → Blue

  • TRACE → White

Solutions:

  1. Include severity keywords

  2. Use consistent format

    • Put severity at start of line

    • Use standard keywords (ERROR, WARN, INFO, DEBUG)

  3. Create custom format

    • Define severity extraction pattern

    • Map custom levels to standard severities

OTLP Format Issues

OTLP Logs Not Appearing

Symptom: OTLP receiver running but no logs in Gonzo.

Diagnosis:

  1. Verify receiver is enabled

  2. Check sender configuration

  3. Test with curl (HTTP)

  4. Check for port conflicts

Solutions:

See Common Issues - OTLP Receiver for detailed fixes.

OTLP Attributes Missing

Symptom: OTLP logs appear but without expected attributes.

Causes:

  1. Attributes in resource vs log record

    • Resource attributes: service.name, host, etc.

    • Log record attributes: user_id, request_id, etc.

    • Both should be extracted

  2. Verify sender includes attributes

  3. Check attribute names

    • Gonzo shows all attributes

    • May just be named differently than expected

Custom Format Issues

Custom Format Not Working

Symptom: --format=my-format shows error or doesn't parse.

Diagnosis:

  1. Verify format file exists

  2. Check YAML syntax

  3. Test with built-in format first

Solutions:

See Custom Formats Guide for:

  • Format file syntax

  • Regex patterns

  • Field mapping

  • Testing formats

Regex Not Matching

Symptom: Custom format regex doesn't extract fields.

Solutions:

  1. Test regex separately

  2. Use online regex tester

    • Test at regex101.com

    • Use example log lines

    • Verify capture groups

  3. Check for special characters

  4. Start simple, iterate

Encoding Issues

Special Characters Garbled

Symptom: Non-ASCII characters display incorrectly.

Solutions:

  1. Ensure UTF-8 encoding

  2. Check file encoding

  3. Pre-filter logs

  4. Use built-in formats when possible

    • JSON and logfmt parsing is optimized

    • Custom regex is slower

Timestamp Issues

Timestamps Not Recognized

Symptom: Logs appear in wrong order or timestamp not extracted.

Common timestamp formats Gonzo recognizes:

Solutions:

  1. Use ISO 8601 format (recommended)

  2. Ensure timestamp field name

    • Common names: timestamp, time, @timestamp, ts

    • Gonzo checks these automatically

  3. Custom format for unusual timestamps

    • Define timestamp extraction in format file

    • Specify timestamp format

Timezone Issues

Symptom: Timestamps appear in wrong timezone.

Solutions:

  1. Use UTC in logs (recommended)

  2. Include timezone offset

  3. Gonzo displays timestamps as received

    • No automatic conversion

    • Format logs consistently at source

Large Log Line Issues

Very Long Lines Truncated

Symptom: Extremely long log lines appear cut off.

Solutions:

  1. Use horizontal scrolling

  2. View in detail modal

  3. Split long lines at source

    • Configure application to use reasonable line length

    • Use structured logging to avoid massive single-line logs

Lines Exceed Buffer

Symptom: Some log lines cause errors or don't appear.

Solution:

Gonzo handles lines up to typical buffer limits. For extremely large lines:

Debugging Format Issues

Test Format Detection

Examine Raw Logs

Compare with Known-Good Format

Common Format Patterns

Application Logs

Go/Logrus:

✅ Parses as JSON automatically

Python/Logging:

⚠️ Plain text - create custom format for structure

Node.js/Winston:

✅ Parses as JSON automatically

System Logs

Syslog:

⚠️ Plain text - consider custom format

Systemd Journal:

⚠️ Key=value but special format - needs custom parser

Container Logs

Docker JSON:

✅ Parses as JSON, extracts nested log

Kubernetes:

✅ Parses as JSON with K8s attributes

Format Best Practices

When Choosing Log Format

  1. Prefer structured formats

    • JSON or logfmt over plain text

    • Easier to parse and analyze

    • Better attribute extraction

  2. Use consistent format

    • Same format across all services

    • Easier to aggregate and search

  3. Include standard fields

    • level or severity: ERROR, WARN, INFO, DEBUG

    • timestamp: ISO 8601 format

    • message or msg: Human-readable message

    • service or service.name: Service identifier

  4. Example good JSON log:

When You Can't Change Format

  1. Use custom format definition

    • Create regex-based parser

    • Map fields to standard attributes

  2. Pre-process logs

    • Use awk/sed to restructure

    • Convert to JSON/logfmt before Gonzo

  3. Use log shipping layer

    • Fluent Bit, Logstash, Vector

    • Transform logs to standard format

Getting Help

Provide This Info for Format Issues

Resources

  • Common Issues - General troubleshooting

  • Custom Formats Guide - Creating format parsers

  • GitHub Issues - Report format bugs

  • Examples Directory - Sample format files

Testing formats? Start with small sample files before processing large logs. This makes debugging much faster.

Last updated