Skip to content

Commit b6cc324

Browse files
authored
Add note on performance to grok parser documentation (influxdata#5291)
1 parent 8ea181d commit b6cc324

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

plugins/parsers/grok/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,14 @@ the file output will only print once per `flush_interval`.
220220
- If successful, add the next token, update the pattern and retest.
221221
- Continue one token at a time until the entire line is successfully parsed.
222222

223+
#### Performance
223224

225+
Performance depends heavily on the regular expressions that you use, but there
226+
are a few techniques that can help:
227+
228+
- Avoid using patterns such as `%{DATA}` that will always match.
229+
- If possible, add `^` and `$` anchors to your pattern:
230+
```
231+
[[inputs.file]]
232+
grok_patterns = ["^%{COMBINED_LOG_FORMAT}$"]
233+
```

0 commit comments

Comments
 (0)