-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
syslog receiver timestamp block not valid #27871
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I think the error is Here's a good reference for how to set it up. This functionality is provided by the This is essentially what you need instead:
|
Right, however that sets the timestamp parsing in an operator block...not in a timestamp block at the root. Furthermore, the events will error out due to timestamp if we try it in operator block...so was hoping this fields was real...assuming the docs are wrong...and could use a bit more advanced example on what happens when the internal parser borks...does that just mean the rfc is not being followed?
Or I guess it says despite the parse error still sends along to the operators...so still may be able to use operator, but would have a ton of parsing errors from the internal parser in this setup. Looks like user will just ditch syslog receiver for tcplog where we can just use the operators to parse. |
Thanks for pointing this out @matthewmodestino. I've confirmed that From a design perspective, I think this is probably for the better, since really the protocol should contain the timestamp, severity, etc.
Can you elaborate on this? I was about to suggest using the standalone receivers:
syslog:
protocol: ...
operators:
- type: time_parser
layout: ... |
Yeah, I think i see whats happening...the internal syslog parser fails, but still sets the action to send...so basically if the rfc is not followed, or doesn't match what is set in
Source is an old Fortinet FortiGate fwiw... I guess it will be key to determine when syslog is being "abused" (as it often is) and not following RFC chosen in |
That makes sense to me. Hopefully some pre-processing before running it through the Maybe the receiver needs to allow special handling for malformed logs. receiver:
syslog:
protocol: ...
err_operators:
- type: router
default: annotate_as_unknown_problem
routes:
- expr: ... # matches some known problem
output: fix_known_problem
- id: annotate_as_unknown_problem
type: add
field: attributes.syslog_error
value: Invalid syslog format
output: noop
- id: fix_known_problem
type: add
field: body
value: ... # fancy expr to correct body
- type: noop # exit point from operators |
Component(s)
receiver/syslog
Describe the issue you're reporting
The
syslogreceiver
docs say you can set atimestamp
block in the root of the receiver config.https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver#configuration
However, while trying to help a user debug an error with their incoming syslog:
2023-10-11T15:44:15.055-0400 error helper/transformer.go:98 Failed to process entry {"kind": "receiver", "name": "syslog", "data_type": "logs", "operator_id": "syslog_input_internal_parser", "operator_type": "syslog_parser", "error": "expecting a Stamp timestamp [col 5]", "action": "send", "entry": {"observed_timestamp":"2023-10-11T15:44:15.055183735-04:00","timestamp":"0001-01-01T00:00:00Z","body":"<189>date=2023-10-11 time=15:44:14 devname=\"FG81EPTKxxxxxxxxx\" devid=\"FG81EPTKxxxxxxxxx\" logid=\"0000000013\" type=\"traffic\" subtype=\"forward\" level=\"notice\" vd=\"root\" eventtime=1697053455006125684 tz=\"-0400\" srcip=192.168.13.16 srcname=\"500-64dba0f5d22a\" srcport=123 srcintf=\"Kape\" srcintfrole=\"lan\" dstip=xxx.xxx.16.12 dstport=123 dstintf=\"wan1\" dstintfrole=\"wan\" sessionid=28068198 proto=17 action=\"accept\" policyid=1 policytype=\"policy\" poluuid=\"17db15fc-2883-51e9-5365-52f4a7edf752\" service=\"NTP\" dstcountry=\"United States\" srccountry=\"Reserved\" trandisp=\"snat\" transip=xx.xx.xx.37 transport=634 appid=16270 app=\"NTP\" appcat=\"Network.Service\" apprisk=\"elevated\" applist=\"default\" duration=180 sentbyte=76 rcvdbyte=76 sentpkt=1 rcvdpkt=1 vwlid=0 utmaction=\"allow\" countapp=1 mastersrcmac=\"xx:xx:a0:f5:d2:2a\" srcmac=\"xx:xx:a0:f5:d2:2a\" srcserver=0","severity":0,"scope_name":""}}
we tried to use the
timestamp
block to properly parse the message and it says the key is invalid.Are we configuring it wrong, or misinterpreting this setting? or is it just incorrect?
Fully understand this may have to do with sender not sending rfc compliant message, but docs read like we may be able to override the
syslog_input_internal_parser
would appreciate a sanity check! /
Thanks team!
The text was updated successfully, but these errors were encountered: