Skip to content

Commit 169ac00

Browse files
docs: document plain text fallback limitations
1 parent b835b88 commit 169ac00

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ loq "SELECT path, AVG(response_time) FROM access.log GROUP BY path"
126126
| **Apache/Nginx** | `192.168.1.1 - - [20/Dec/2024:10:00:00 +0000] "GET /api HTTP/1.1" 200 1234` |
127127
| **Syslog** | `Dec 20 12:34:56 myhost myapp[1234]: Message` |
128128
| **CLF** | `127.0.0.1 - - [10/Oct/2000:13:55:36 -0700] "GET / HTTP/1.0" 200 2326` |
129+
| **Plain text** | Fallback - entire line as `message`, no field extraction |
130+
131+
> **Note:** Plain text mode has limited query support. Use `message contains "ERROR"` instead of `level=error`. For full query capabilities, use structured logging (JSON) or create a custom format.
129132
130133
### Custom formats
131134

docs/guide/log-formats.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,30 @@ Dec 20 12:34:56 myhost myapp[1234]: Message here
3838
```
3939
127.0.0.1 - - [10/Oct/2000:13:55:36 -0700] "GET /index.html HTTP/1.0" 200 2326
4040
```
41+
42+
## Plain Text (Fallback)
43+
44+
When loq doesn't recognize a log format, it falls back to plain text mode:
45+
46+
```
47+
Application started successfully
48+
ERROR: Something went wrong
49+
[2024-01-15] Custom format not recognized
50+
```
51+
52+
**Limitations of plain text mode:**
53+
- The entire line is stored as `message`
54+
- No `level`, `timestamp`, or other fields are extracted
55+
- Field-based queries like `level=error` won't match
56+
57+
**Workarounds:**
58+
59+
1. Use `message contains` instead of field queries:
60+
```bash
61+
loq app.log where message contains "ERROR"
62+
loq app.log where message matches "^ERROR:"
63+
```
64+
65+
2. Create a [custom format](/guide/custom-formats) to properly parse your logs
66+
67+
**Tip:** For best results, use structured logging (JSON) in your applications. This gives you full query capabilities on any field.

0 commit comments

Comments
 (0)