Graylog2 / Graylog2/graylog2-server
Notes on grok patterns
- Dominant language
- Java
- Stars
- 8.1k
- Forks
- 1.1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 217
Description
I'm building a grok pattern to convert Proxmox PVE task UPIDs into fields:
`UPID:%{WORD:node_name}:%{BASE16NUM:pid_hex}:%{BASE16NUM:start_time_hex}:%{BASE16NUM:tid_hex}:%{WORD:task_type}:(%{INT:vmid})?:%{USERNAME:user}`
These fields are as follows:
%{WORD:node_name} matches the node name.
%{BASE16NUM:pid_hex} matches the PID in hexadecimal and labels it as pid_hex.
%{BASE16NUM:start_time_hex} matches the start time in hexadecimal as start_time_hex.
%{BASE16NUM:tid_hex} matches the TID in hexadecimal as tid_hex.
%{WORD:task_type} matches the task type (like qmstart) and labels it as task_type.
%{INT:vmid} matches the VMID and labels it as vmid.
%{USERNAME:user} matches the username and labels it as user.
This works as expected:

However, it's possible that a UPID task exists without a vmid, e.g. a backup task, or various other tasks like uploading an ISO via the web UI, or Proxmox updating its HTTPS certificate, or whatever. So we can see above, I've marked the vmid field as optional. This also works as expected:

Given a long enough timeline, I'm going to forget why I've made that field optional though. Therefore, it would be nice to have a text box on the grok pattern editor where I can write notes for future Damian to help him remember.
## Your Environment
Graylog Version: Graylog 6.0.0-beta.4+4648d2d
Java Version: Embedded
OpenSearch Version: 2.12.0
MongoDB Version: 7.0.6
Operating System: Debian 12
Browser version: Chrome Version 123.0.6312.59 (Official Build) (arm64)
Contributor guide
Assessment
This issue has not been assessed yet.