Align Log File Columns for Analysis

Align columns in log file output for easier visual analysis. Works with space-delimited, tab-delimited, and custom log formats.

Data Tables

Detailed Explanation

Formatting Log File Output

Application and server log files often contain structured data in a loosely columnar format. Timestamps, log levels, module names, and messages are separated by spaces or tabs, but inconsistent widths make it hard to quickly scan for patterns.

Before

2024-01-15T10:23:45 INFO auth Login successful user=alice ip=192.168.1.10
2024-01-15T10:23:47 WARN db Connection pool 80% full host=db-01
2024-01-15T10:23:48 ERROR api Request timeout path=/api/v2/users duration=30s
2024-01-15T10:23:50 INFO cache Cache hit rate=95.2% keys=1240
2024-01-15T10:24:01 ERROR auth Failed login user=unknown ip=10.0.0.5

After (first 4 columns aligned)

2024-01-15T10:23:45  INFO   auth   Login successful user=alice ip=192.168.1.10
2024-01-15T10:23:47  WARN   db     Connection pool 80% full host=db-01
2024-01-15T10:23:48  ERROR  api    Request timeout path=/api/v2/users duration=30s
2024-01-15T10:23:50  INFO   cache  Cache hit rate=95.2% keys=1240
2024-01-15T10:24:01  ERROR  auth   Failed login user=unknown ip=10.0.0.5

Choosing the Delimiter

Log files typically use a single space between fields. Use Space (1) if each field is exactly one token, or Spaces (2+) if the original log already has some padding between columns. If your log format uses tabs, select Tab.

Partial Alignment

Log messages (the last "column") often contain variable-length free text. The tool pads it like any other column, but since it is the last column, the trailing padding is trimmed. This means the message portion is left as-is, while the structured prefix columns are neatly aligned.

Filtering Before Aligning

For very large log files, consider filtering to a subset of lines first (using grep or a log analysis tool), then paste the filtered results here for alignment. This keeps the alignment fast and the output manageable.

Use Case

A site-reliability engineer extracts a set of error-level log entries and aligns the timestamp, level, and module columns to quickly identify patterns.

Try It — Text Column Aligner

Open full tool