Graylog2 / Graylog2/graylog2-server

Notes on grok patterns

Open
#18,855 0 comments 0 reactions 0 assignees View on GitHub
feature triaged
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:

![image](https://github.com/Graylog2/graylog2-server/assets/2953243/d1a50f08-567d-4b4d-995b-b5d2dff1571e)

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:

![image](https://github.com/Graylog2/graylog2-server/assets/2953243/146e95e6-1ca4-442a-9a4e-a620f6fc1ae8)

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.