alloy: Error parsing syslog stream UDP

What’s wrong?

I have updated to grafana-agent-flow-0.38.0-rc.0-1.amd64.deb in order to have syslog via UDP working. This was fixed in https://github.com/grafana/agent/issues/5197

For the moment we are sending syslog messages from PFSense, Mikrotik and Unifi devices.

From Mikrotik and Unify devices we get the message in journald: msg="error parsing syslog stream" component=loki.source.syslog.syslog err="expecting a version value in the range 1-999 [col 4]"

From PFSense we get the message: msg="error parsing syslog stream" component=loki.source.syslog.syslog err="expecting a version value in the range 1-999 [col 5]

Steps to reproduce

Install grafana-agent-flow-0.38.0-rc.0-1.amd64.deb on a Debian12 VM with the config below and send remote syslog messages to the agent via UDP.

System information

Debian 12.2 x86_64 Linux

Software version

Grafana Agent 0.38.0-rc.0

Configuration

loki.relabel "syslog" {
  forward_to = []

  rule {
    source_labels = ["__syslog_message_hostname"]
    target_label  = "host"
  }
}
loki.source.syslog "syslog" {
  listener {
    address  = "0.0.0.0:5514"
    protocol = "tcp"
    labels   = { component = "loki.source.syslog", protocol = "tcp"}
  }

  listener {
    address  = "0.0.0.0:5514"
    protocol = "udp"
    labels   = { component = "loki.source.syslog", protocol = "udp"}
    use_rfc5424_message = true
  }

  relabel_rules = loki.relabel.syslog.rules
  forward_to = [loki.write.local.receiver]
}

loki.write "local" {
    endpoint {
        url = "http://127.0.0.1:3100/loki/api/v1/push"
    }
    external_labels = {}
}

Logs

Nov 17 15:26:07 logserver grafana-agent-flow[1308]: ts=2023-11-17T13:26:07.294962163Z level=warn msg="error parsing syslog stream" component=loki.source.syslog.syslog err="expecting a version value in the range 1-999 [col 4]"
Nov 17 15:30:08 logserver grafana-agent-flow[1308]: ts=2023-11-17T13:30:08.800809677Z level=warn msg="error parsing syslog stream" component=loki.source.syslog.syslog err="expecting a version value in the range 1-999 [col 5]"

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 25 (11 by maintainers)

Most upvoted comments

Hello, yes it will be part of v1.5 which is planned for the end of next week

I see this change doesn’t squeeze into v1.4.3 . Will it be included in the next release ?

@rarrr I’ve made a PR for Loki to support such things, see: https://github.com/grafana/loki/pull/12810

I can confirm this is also happening on my side with v0.38.0:

ts=2023-11-22T07:32:20.372128155Z level=warn msg=“error parsing syslog stream” component=loki.source.syslog.syslogudp err=“expecting a version value in the range 1-999 [col 4]”

These are some sample messages from the 3 devices:

PFSense:
<43>Nov 21 14:51:10 syslogd: exiting on signal 15

Mikrotik:
<30>Nov 21 12:15:02 BSD CRS Office user admin logged out from 172.31.1.200 via telnet

Unify:
<14>USwitch5-Dev 245a4c16aaaa,USW_FLEX_MINI-1.8.6.694: UENV: syslog_port is deleted

<29>Nov 21 12:13:25 US48,7483c216aaaa,v4.3.21.11325 switch: TRAPMGR: Link Down: 0/28

I have tried to reproduce with this line that almost gave the same error:

 echo '<14>unifi Nov 21 12:04:01 BSD CRS Office user admin logged in from 172.31.1.200 via telnet' | nc -v -u -w 0 127.0.0.1 5514

You have attached a pcap file captured with tcpdump of this message. mikrotik.pcap.zip