Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parse_syslog Remap function should produce an integer for procid #5735

Closed
binarylogic opened this issue Dec 28, 2020 · 5 comments
Closed
Assignees
Labels
domain: vrl Anything related to the Vector Remap Language type: enhancement A value-adding code change that enhances its existing functionality.

Comments

@binarylogic
Copy link
Contributor

binarylogic commented Dec 28, 2020

Process IDs, to my knowledge, are always integers. Therefore, the parse_syslog should produce an integer for the procid field.

@binarylogic binarylogic added type: enhancement A value-adding code change that enhances its existing functionality. domain: vrl Anything related to the Vector Remap Language labels Dec 28, 2020
@binarylogic binarylogic added this to the 2020-12-21 Kryptek Yeti milestone Dec 28, 2020
@lucperkins
Copy link
Contributor

@binarylogic Intuitively it absolutely seems like it should be an integer, but according to RFC 5424 it can also be NILVALUE, which in Syslog is -. So as far as I can tell it does need to be a string.

@jszwedko
Copy link
Member

jszwedko commented Dec 28, 2020

We could opt to parse - literally as null so that it could be represented as a null or integer in remap's type system. There is some precedence for this in #5489

@binarylogic
Copy link
Contributor Author

That was going to be my suggestion, we should not preserve the - character.

@StephenWakely
Copy link
Contributor

The ProcId doesn't necessarily have to be the pid, it can also hold the process name. I can't find any examples in the wild where the name is used, but it is possible according to the RFC.

The PROCID field is often used to provide the process name or process ID associated with a syslog system.

Current if it is a pid, this function is returning an integer:

$ $sys = parse_syslog("<133>Jun 13 16:33:35 haproxy[73411]: Proxy sticky-servers started.")
{ "appname": "haproxy", "facility": "local0", "message": "Proxy sticky-servers started.", "procid": 73411, "severity": "notice", "timestamp": 2020-06-13 15:33:35 UTC }

$ $sys.procid
73411

If it in a process name, it returns a string.

It doesn't do any special handling for - though, so this still needs to be done.

$ $sys = parse_syslog("<133>Jun 13 16:33:35 haproxy[-]: Proxy sticky-servers started.")
{ "appname": "haproxy", "facility": "local0", "message": "Proxy sticky-servers started.", "procid": "-", "severity": "notice", "timestamp": 2020-06-13 15:33:35 UTC }

$ $sys.procid
"-"

@jamtur01 jamtur01 removed this from the 2020-12-21 Kryptek Yeti milestone Jan 4, 2021
@binarylogic
Copy link
Contributor Author

Didn't know that! Closing as a result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: vrl Anything related to the Vector Remap Language type: enhancement A value-adding code change that enhances its existing functionality.
Projects
None yet
Development

No branches or pull requests

5 participants