Skip to content

Commit

Permalink
deps: Syslog version priority (#593)
Browse files Browse the repository at this point in the history
* updated range for syslog version and priority ranges

* added back test RFC5424
  • Loading branch information
armstrmi authored Mar 3, 2022
1 parent 9cec988 commit efa4544
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
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

0 comments on commit efa4544

Please sign in to comment.