Skip to content

Commit

Permalink
Add allow skip pri otion to syslog. (#30869)
Browse files Browse the repository at this point in the history
**Description:** Currently syslog parser (and receiver) are enforcing a
pri header at the beginning of each syslog message. This behavior is
incorrect since syslog RFC doesn't require a pri header.

to fix this I added a new 'allow_skip_pri_header' (default false) to
syslog config to allow users to choose if they want to allow the parser
to skip the pri existence validation.

the main issue was that the syslog parser is using influxdata/go-syslog
library which unfortunately is not maintained anymore (according to the
repo PR history).

we had a couple of options to fix it and after a long discussion
[here](#30397)
we have decided to move to a new forked repo.

so I forked the repo, made the necessary changes and updated the syslog
parser to start using the new repo.

after that, I ran:  make goproto, make crosslink, make -j8 gotidy.
and as a result many files (mostly go.mod and go.sum) files changed.


**Link to tracking Issue:**
#30397

**Testing:** Manual testing for both RFC 3164 and 5424 with and without
pri header.

---------

Co-authored-by: Andrzej Stencel <astencel@sumologic.com>
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
  • Loading branch information
3 people committed Feb 8, 2024
1 parent 05ecf08 commit dab7d3f
Show file tree
Hide file tree
Showing 46 changed files with 251 additions and 62 deletions.
28 changes: 28 additions & 0 deletions .chloggen/allow-pri-header-skip-syslog-stanza.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: pkg/stanza

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Add 'allow_skip_pri_header' flag to syslog setting."

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [30397]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
Allow parsing syslog records without PRI header. Currently pri header is beng enforced although it's not mandatory by the RFC standard. Since influxdata/go-syslog is not maintained we had to switch to haimrubinstein/go-syslog.
# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
2 changes: 1 addition & 1 deletion cmd/configschema/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ require (
github.com/grobie/gomemcache v0.0.0-20230213081705-239240bbc445 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/haimrubinstein/go-syslog/v3 v3.0.0 // indirect
github.com/hashicorp/consul/api v1.27.0 // indirect
github.com/hashicorp/cronexpr v1.1.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -401,7 +402,6 @@ require (
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4 // indirect
github.com/influxdata/influxdb-observability/common v0.5.8 // indirect
github.com/influxdata/influxdb-observability/influx2otel v0.5.8 // indirect
github.com/influxdata/influxdb-observability/otel2influx v0.5.8 // indirect
Expand Down
4 changes: 3 additions & 1 deletion cmd/configschema/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/haimrubinstein/go-syslog/v3 v3.0.0 // indirect
github.com/hashicorp/consul/api v1.27.0 // indirect
github.com/hashicorp/cronexpr v1.1.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -453,7 +454,6 @@ require (
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4 // indirect
github.com/influxdata/influxdb-observability/common v0.5.8 // indirect
github.com/influxdata/influxdb-observability/influx2otel v0.5.8 // indirect
github.com/influxdata/influxdb-observability/otel2influx v0.5.8 // indirect
Expand Down
4 changes: 3 additions & 1 deletion cmd/otelcontribcol/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/oteltestbedcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ require (
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
github.com/haimrubinstein/go-syslog/v3 v3.0.0 // indirect
github.com/hashicorp/consul/api v1.25.1 // indirect
github.com/hashicorp/cronexpr v1.1.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -135,7 +136,6 @@ require (
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4 // indirect
github.com/ionos-cloud/sdk-go/v6 v6.1.9 // indirect
github.com/jaegertracing/jaeger v1.53.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand Down
4 changes: 3 additions & 1 deletion cmd/oteltestbedcol/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion connector/datadogconnector/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion exporter/datadogexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ require (
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/haimrubinstein/go-syslog/v3 v3.0.0 // indirect
github.com/hashicorp/consul/api v1.27.0 // indirect
github.com/hashicorp/cronexpr v1.1.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -155,7 +156,6 @@ require (
github.com/hetznercloud/hcloud-go/v2 v2.4.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4 // indirect
github.com/ionos-cloud/sdk-go/v6 v6.1.9 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand Down
4 changes: 3 additions & 1 deletion exporter/datadogexporter/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions exporter/datadogexporter/integrationtest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/haimrubinstein/go-syslog/v3 v3.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
Expand Down
4 changes: 3 additions & 1 deletion exporter/datadogexporter/integrationtest/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/haimrubinstein/go-syslog/v3 v3.0.0 // indirect
github.com/hashicorp/consul/api v1.27.0 // indirect
github.com/hashicorp/cronexpr v1.1.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -423,7 +424,6 @@ require (
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4 // indirect
github.com/influxdata/influxdb-observability/common v0.5.8 // indirect
github.com/influxdata/influxdb-observability/influx2otel v0.5.8 // indirect
github.com/influxdata/influxdb-observability/otel2influx v0.5.8 // indirect
Expand Down
4 changes: 3 additions & 1 deletion go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dab7d3f

Please sign in to comment.