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

Update go-syslog to accept non-UTF8 encoding in syslog message #2127

Merged
merged 1 commit into from
May 26, 2020

Conversation

bastjan
Copy link
Contributor

@bastjan bastjan commented May 25, 2020

What this PR does / why we need it:

Related to influxdata/go-syslog#35.

Stops promtail from dropping syslog connections if the message does contain characters in a non-UTF8 encoding. RFC5424 explicitly allows non-UTF8 messages.

File target passes non-UTF8 text as-is too.

Which issue(s) this PR fixes:

Fixes #1783

Special notes for your reviewer:

Casting to *rfc5424.SyslogMessage is now necessary since since go-syslog could now support rfc3164 (BSD syslog) if enabled.

Checklist

  • Documentation added
  • Tests updated

@codecov-commenter
Copy link

Codecov Report

Merging #2127 into master will increase coverage by 0.11%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2127      +/-   ##
==========================================
+ Coverage   61.25%   61.37%   +0.11%     
==========================================
  Files         146      146              
  Lines       11196    11197       +1     
==========================================
+ Hits         6858     6872      +14     
+ Misses       3793     3777      -16     
- Partials      545      548       +3     
Impacted Files Coverage Δ
pkg/promtail/targets/syslogparser/syslogparser.go 100.00% <ø> (ø)
pkg/promtail/targets/syslogtarget.go 74.83% <81.81%> (+0.16%) ⬆️
pkg/promtail/targets/tailer.go 76.13% <0.00%> (-2.28%) ⬇️
pkg/promtail/positions/positions.go 60.71% <0.00%> (+13.39%) ⬆️

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Nice work !

Thank you Sebastian for this !

@cyriltovena cyriltovena merged commit d175fa5 into grafana:master May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

promtail syslog receiver aborts on non-UTF8 logs
3 participants