properly update the cs_syslogsource_parsed_total metric (#2608)

This commit is contained in:
blotus 2023-11-22 09:04:23 +01:00 committed by GitHub
parent a51bce8f8d
commit d7ef51e6ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -211,8 +211,10 @@ func (s *SyslogSource) handleSyslogMsg(out chan types.Event, t *tomb.Tomb, c cha
continue
}
line = s.buildLogFromSyslog(p2.Timestamp, p2.Hostname, p2.Tag, p2.PID, p2.Message)
linesParsed.With(prometheus.Labels{"source": syslogLine.Client, "type": "rfc5424"}).Inc()
} else {
line = s.buildLogFromSyslog(p.Timestamp, p.Hostname, p.Tag, p.PID, p.Message)
linesParsed.With(prometheus.Labels{"source": syslogLine.Client, "type": "rfc3164"}).Inc()
}
line = strings.TrimSuffix(line, "\n")