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

deps: Syslog version priority #593

Merged
merged 2 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/kardianos/service v1.2.0
github.com/mitchellh/mapstructure v1.4.1
github.com/observiq/ctimefmt v1.0.0
github.com/observiq/go-syslog/v3 v3.0.2
github.com/observiq/go-syslog/v3 v3.1.0
github.com/observiq/goflow/v3 v3.4.4
github.com/observiq/nanojack v0.0.0-20201106172433-343928847ebc
github.com/spf13/cobra v1.2.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,8 @@ github.com/observiq/ctimefmt v1.0.0 h1:r7vTJ+Slkrt9fZ67mkf+mA6zAdR5nGIJRMTzkUyvi
github.com/observiq/ctimefmt v1.0.0/go.mod h1:mxi62//WbSpG/roCO1c6MqZ7zQTvjVtYheqHN3eOjvc=
github.com/observiq/go-syslog/v3 v3.0.2 h1:vaeINFErM/E3cKE2Ot1FAhhGq5mv7uGBOzjnGL3qhbY=
github.com/observiq/go-syslog/v3 v3.0.2/go.mod h1:9abcumkQwDUY0VgWdH6CaaJ3Ks39A7NvIelMlavPru0=
github.com/observiq/go-syslog/v3 v3.1.0 h1:9zgjNZ2mix7H68Njz6QkZLf4pfZEoWeZRMrDYicX4no=
github.com/observiq/go-syslog/v3 v3.1.0/go.mod h1:9abcumkQwDUY0VgWdH6CaaJ3Ks39A7NvIelMlavPru0=
github.com/observiq/goflow/v3 v3.4.4 h1:wobLnBqdKGQVdkBDymngcQgbg+9ZzUGEdljUnCS2XoA=
github.com/observiq/goflow/v3 v3.4.4/go.mod h1:VVPbaBEcfR0r+VaYwg6iDXws68r68AsCwLFegONP4nM=
github.com/observiq/nanojack v0.0.0-20201106172433-343928847ebc h1:49ewVBwLcy+eYqI4R0ICilCI4dPjddpFXWv3liXzUxM=
Expand Down
60 changes: 60 additions & 0 deletions operator/builtin/parser/syslog/syslog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,66 @@ func TestSyslogParser(t *testing.T) {
expectedSeverity entry.Severity
expectedSeverityText string
}{
{
"Priority Range",
func() *SyslogParserConfig {
cfg := basicConfig()
cfg.Protocol = "rfc5424"
return cfg
}(),
`<200>1 2015-08-05T21:58:59.693Z 192.168.2.132 SecureAuth0 23108 ID52020 [SecureAuth@27389 UserHostAddress="192.168.2.132" Realm="SecureAuth0" UserID="Tester2" PEN="27389"] Found the user for retrieving user's profile`,
time.Date(2015, 8, 5, 21, 58, 59, 693000000, time.UTC),
map[string]interface{}{
"appname": "SecureAuth0",
"facility": 25,
"hostname": "192.168.2.132",
"message": "Found the user for retrieving user's profile",
"msg_id": "ID52020",
"priority": 200,
"proc_id": "23108",
"structured_data": map[string]map[string]string{
"SecureAuth@27389": {
"PEN": "27389",
"Realm": "SecureAuth0",
"UserHostAddress": "192.168.2.132",
"UserID": "Tester2",
},
},
"version": 1,
},
entry.Emergency,
"emerg",
},
{
"Version Range",
func() *SyslogParserConfig {
cfg := basicConfig()
cfg.Protocol = "rfc5424"
return cfg
}(),
`<86>65535 2015-08-05T21:58:59.693Z 192.168.2.132 SecureAuth0 23108 ID52020 [SecureAuth@27389 UserHostAddress="192.168.2.132" Realm="SecureAuth0" UserID="Tester2" PEN="27389"] Found the user for retrieving user's profile`,
time.Date(2015, 8, 5, 21, 58, 59, 693000000, time.UTC),
map[string]interface{}{
"appname": "SecureAuth0",
"facility": 10,
"hostname": "192.168.2.132",
"message": "Found the user for retrieving user's profile",
"msg_id": "ID52020",
"priority": 86,
"proc_id": "23108",
"structured_data": map[string]map[string]string{
"SecureAuth@27389": {
"PEN": "27389",
"Realm": "SecureAuth0",
"UserHostAddress": "192.168.2.132",
"UserID": "Tester2",
},
},
"version": 65535,
},
entry.Info,
"info",
},
{
"RFC3164",
func() *SyslogParserConfig {
Expand Down