From a9f7f79b566a8d6dc0746db095214f49ffce86d8 Mon Sep 17 00:00:00 2001 From: Taylor Swanson Date: Mon, 25 Apr 2022 14:30:58 -0500 Subject: [PATCH 1/9] [libbeat] Improve syslog parser/processor error handling - Shifted most of the validation logic to the host language instead of the Ragel parser. This allows for the message to be fully parsed even if there are validation errors with one or more fields. - Errors are accumulated as they occur, any fields that have already been parsed and validated will be returned, alongside error.message. - Priority field for RFC 3164 messages are now optional, as some syslog providers will omit this part of the header (especially when writing to files). - Structured data fields for RFC 5424 messages are processed in a second pass. If the structured data format doesn't fit the RFC, it will be prepended to the message, separated by a space. - Structured data now uses map[string]interface{} - Update testify to v1.7.1 dependency for assert.ErrorContains support --- go.mod | 2 +- go.sum | 3 +- libbeat/processors/syslog/syslog.go | 10 +- libbeat/processors/syslog/syslog_test.go | 6 +- libbeat/reader/syslog/message.go | 88 +- libbeat/reader/syslog/message_test.go | 296 +- libbeat/reader/syslog/parser/common.rl | 53 +- .../reader/syslog/parser/parser_rfc3164.rl | 16 +- .../reader/syslog/parser/parser_rfc5424.rl | 58 +- libbeat/reader/syslog/parser/rfc3164.rl | 4 +- libbeat/reader/syslog/parser/rfc5424.rl | 86 +- libbeat/reader/syslog/rfc3164_gen.go | 6995 +-------- libbeat/reader/syslog/rfc3164_test.go | 295 +- libbeat/reader/syslog/rfc5424_gen.go | 12063 +++------------- libbeat/reader/syslog/rfc5424_test.go | 319 +- libbeat/reader/syslog/syslog.go | 73 +- libbeat/reader/syslog/syslog_test.go | 6 +- libbeat/reader/syslog/util.go | 16 + libbeat/reader/syslog/util_test.go | 45 + 19 files changed, 3387 insertions(+), 17047 deletions(-) diff --git a/go.mod b/go.mod index 1e0e9d1546f0..ca6d8f5c2280 100644 --- a/go.mod +++ b/go.mod @@ -120,7 +120,7 @@ require ( github.com/shopspring/decimal v1.2.0 github.com/spf13/cobra v1.3.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.7.0 + github.com/stretchr/testify v1.7.1 github.com/tsg/go-daemon v0.0.0-20200207173439-e704b93fd89b github.com/ugorji/go/codec v1.1.8 github.com/urso/sderr v0.0.0-20210525210834-52b04e8f5c71 diff --git a/go.sum b/go.sum index d3129240f7f3..0de17815d4aa 100644 --- a/go.sum +++ b/go.sum @@ -1594,8 +1594,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.0/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= diff --git a/libbeat/processors/syslog/syslog.go b/libbeat/processors/syslog/syslog.go index cd8262467154..fb74d7f26d74 100644 --- a/libbeat/processors/syslog/syslog.go +++ b/libbeat/processors/syslog/syslog.go @@ -172,14 +172,16 @@ func (p *processor) run(event *beat.Event) error { fields, ts, err := syslog.ParseMessage(data, p.Format, p.TimeZone.Location()) if err != nil { p.stats.Failure.Inc() - return err + } else { + p.stats.Success.Inc() } jsontransform.WriteJSONKeys(event, fields, false, p.OverwriteKeys, !p.IgnoreFailure) - event.Timestamp = ts - p.stats.Success.Inc() + if !ts.IsZero() { + event.Timestamp = ts + } - return nil + return err } // String will return a string representation of this processor (the configuration). diff --git a/libbeat/processors/syslog/syslog_test.go b/libbeat/processors/syslog/syslog_test.go index f12185a43f9a..34f3c392bfa2 100644 --- a/libbeat/processors/syslog/syslog_test.go +++ b/libbeat/processors/syslog/syslog_test.go @@ -113,11 +113,11 @@ var syslogCases = map[string]struct { "procid": "1024", "msgid": "ID47", "version": "1", - "structured_data": map[string]map[string]string{ - "examplePriority@32473": { + "structured_data": map[string]interface{}{ + "examplePriority@32473": map[string]interface{}{ "class": "high", }, - "exampleSDID@32473": { + "exampleSDID@32473": map[string]interface{}{ "eventID": "1011", "eventSource": "Application", "iut": "3", diff --git a/libbeat/reader/syslog/message.go b/libbeat/reader/syslog/message.go index c676be939625..0ded09467f74 100644 --- a/libbeat/reader/syslog/message.go +++ b/libbeat/reader/syslog/message.go @@ -18,6 +18,7 @@ package syslog import ( + "fmt" "strconv" "strings" "time" @@ -82,37 +83,55 @@ type message struct { pid string // RFC-5424 fields. - msgID string - version int - structuredData map[string]map[string]string + msgID string + version int + rawSDValue string } // setTimestampRFC3339 sets the timestamp for this message using an RFC3339 timestamp (time.RFC3339Nano). -func (m *message) setTimestampRFC3339(v string) { - if t, err := time.Parse(time.RFC3339Nano, v); err == nil { +func (m *message) setTimestampRFC3339(v string) error { + t, err := time.Parse(time.RFC3339Nano, v) + if err == nil { m.timestamp = t } + + return err } // setTimestampBSD sets the timestamp for this message using a BSD-style timestamp (time.Stamp). Since these // timestamps lack year and timezone information, the year will be derived from the current time (adjusted for // loc) and the timezone will be provided by loc. -func (m *message) setTimestampBSD(v string, loc *time.Location) { +func (m *message) setTimestampBSD(v string, loc *time.Location) error { if loc == nil { loc = time.Local } - if t, err := time.ParseInLocation(time.Stamp, v, loc); err == nil { + t, err := time.ParseInLocation(time.Stamp, v, loc) + if err == nil { t = t.AddDate(time.Now().In(loc).Year(), 0, 0) m.timestamp = t } + + return err } // setPriority sets the priority for this message. The facility and severity are // derived from the priority and associated values are set. -func (m *message) setPriority(v string) { +func (m *message) setPriority(v string) error { + priority, err := strconv.Atoi(v) + if err != nil { + return fmt.Errorf("invalid priority: %w", err) + } + + // Range defined by RFC. + if priority < 0 || priority > 191 { + return ErrPriority + } + m.priority = stringToInt(v) m.facility = m.priority >> facilityShift m.severity = m.priority & severityMask + + return nil } // setHostname sets the hostname for this message. If the value is the "nil value" (-), the hostname will NOT be set. @@ -160,32 +179,39 @@ func (m *message) setMsgID(v string) { } // setVersion sets the version for this message. -func (m *message) setVersion(v string) { - n := stringToInt(v) - m.version = n +func (m *message) setVersion(v string) error { + version, err := strconv.Atoi(v) + if err != nil { + return fmt.Errorf("invalid version, expected an integer: %w", err) + } + + m.version = version + + return nil } -// setDataValue sets a structured data value. 'id' must already exist in the -// structured data map, otherwise the value will not be set. -func (m *message) setDataValue(id, key, value string) { - if _, okID := m.structuredData[id]; okID { - m.structuredData[id][key] = value +func (m *message) setRawSDValue(v string) { + if v != "-" { + m.rawSDValue = v } } // fields produces fields from the message. func (m message) fields() mapstr.M { f := mapstr.M{} + msg := m.msg // Syslog fields. - _, _ = f.Put("log.syslog.priority", m.priority) - _, _ = f.Put("log.syslog.facility.code", m.facility) - _, _ = f.Put("log.syslog.severity.code", m.severity) - if v, ok := mapIndexToString(m.severity, severityLabels); ok { - _, _ = f.Put("log.syslog.severity.name", v) - } - if v, ok := mapIndexToString(m.facility, facilityLabels); ok { - _, _ = f.Put("log.syslog.facility.name", v) + if m.priority >= 0 { + _, _ = f.Put("log.syslog.priority", m.priority) + _, _ = f.Put("log.syslog.facility.code", m.facility) + _, _ = f.Put("log.syslog.severity.code", m.severity) + if v, ok := mapIndexToString(m.severity, severityLabels); ok { + _, _ = f.Put("log.syslog.severity.name", v) + } + if v, ok := mapIndexToString(m.facility, facilityLabels); ok { + _, _ = f.Put("log.syslog.facility.name", v) + } } if m.process != "" { _, _ = f.Put("log.syslog.appname", m.process) @@ -202,13 +228,19 @@ func (m message) fields() mapstr.M { if m.version != 0 { _, _ = f.Put("log.syslog.version", strconv.Itoa(m.version)) } - if len(m.structuredData) > 0 { - _, _ = f.Put("log.syslog.structured_data", m.structuredData) + if data := parseStructuredData(m.rawSDValue); data != nil { + _, _ = f.Put("log.syslog.structured_data", data) + } else { + // Raw structured data value is prepended to the message field + // if it could not be parsed properly. The message is not altered + // if no structured data was extracted from the message (nil value was + // used or message format is not RFC 5424). + msg = joinStr(m.rawSDValue, m.msg, " ") } // Message field. - if m.msg != "" { - _, _ = f.Put("message", m.msg) + if msg != "" { + _, _ = f.Put("message", msg) } return f diff --git a/libbeat/reader/syslog/message_test.go b/libbeat/reader/syslog/message_test.go index 58a71f1ff817..a997526355e7 100644 --- a/libbeat/reader/syslog/message_test.go +++ b/libbeat/reader/syslog/message_test.go @@ -55,9 +55,10 @@ func mustParseTime(layout, value string, loc *time.Location) time.Time { func TestMessage_SetTimestampBSD(t *testing.T) { cases := map[string]struct { - In string - InLoc *time.Location - Want time.Time + In string + InLoc *time.Location + Want time.Time + WantErr string }{ "bsd-timestamp": { In: "Oct 1 22:04:15", @@ -88,17 +89,23 @@ func TestMessage_SetTimestampBSD(t *testing.T) { t.Parallel() var m message - m.setTimestampBSD(tc.In, tc.InLoc) + gotErr := m.setTimestampBSD(tc.In, tc.InLoc) - assert.Equal(t, tc.Want, m.timestamp) + if tc.WantErr != "" { + assert.ErrorContains(t, gotErr, tc.WantErr) + assert.True(t, m.timestamp.IsZero()) + } else { + assert.Equal(t, tc.Want, m.timestamp) + } }) } } func TestMessage_SetTimestampRFC3339(t *testing.T) { cases := map[string]struct { - In string - Want time.Time + In string + Want time.Time + WantErr string }{ "rfc3339-timestamp": { In: "1985-04-12T23:20:50.52Z", @@ -137,9 +144,14 @@ func TestMessage_SetTimestampRFC3339(t *testing.T) { t.Parallel() var m message - m.setTimestampRFC3339(tc.In) + gotErr := m.setTimestampRFC3339(tc.In) - assert.Equal(t, tc.Want, m.timestamp) + if tc.WantErr != "" { + assert.ErrorContains(t, gotErr, tc.WantErr) + assert.True(t, m.timestamp.IsZero()) + } else { + assert.Equal(t, tc.Want, m.timestamp) + } }) } } @@ -150,6 +162,7 @@ func TestMessage_SetPriority(t *testing.T) { WantPriority int WantFacility int WantSeverity int + WantErr string }{ "13": { In: "13", @@ -157,8 +170,17 @@ func TestMessage_SetPriority(t *testing.T) { WantFacility: 1, WantSeverity: 5, }, + "192": { + In: "192", + WantErr: ErrPriority.Error(), + }, + "-1": { + In: "-1", + WantErr: ErrPriority.Error(), + }, "empty": { - In: "", + In: "", + WantErr: `invalid priority: strconv.Atoi: parsing "": invalid syntax`, }, } @@ -166,13 +188,21 @@ func TestMessage_SetPriority(t *testing.T) { tc := tc t.Run(name, func(t *testing.T) { t.Parallel() - var m message - - m.setPriority(tc.In) - - assert.Equal(t, tc.WantPriority, m.priority) - assert.Equal(t, tc.WantFacility, m.facility) - assert.Equal(t, tc.WantSeverity, m.severity) + m := message{priority: -1} + + gotErr := m.setPriority(tc.In) + + if tc.WantErr != "" { + assert.ErrorContains(t, gotErr, tc.WantErr) + assert.Equal(t, m.priority, -1) + assert.Zero(t, m.facility) + assert.Zero(t, m.severity) + } else { + assert.NoError(t, gotErr) + assert.Equal(t, tc.WantPriority, m.priority) + assert.Equal(t, tc.WantFacility, m.facility) + assert.Equal(t, tc.WantSeverity, m.severity) + } }) } } @@ -380,15 +410,17 @@ func TestMessage_SetMsgID(t *testing.T) { func TestMessage_SetVersion(t *testing.T) { cases := map[string]struct { - In string - Want int + In string + Want int + WantErr string }{ "valid": { In: "100", Want: 100, }, "empty": { - In: "", + In: "", + WantErr: "invalid version: strconv.Atoi: parsing \"\": invalid syntax", }, } @@ -399,55 +431,107 @@ func TestMessage_SetVersion(t *testing.T) { var m message - m.setVersion(tc.In) + gotErr := m.setVersion(tc.In) + + if tc.WantErr != "" { + assert.ErrorContains(t, gotErr, tc.WantErr) + assert.Zero(t, m.version) + } else { + assert.NoError(t, gotErr) + assert.Equal(t, tc.Want, m.version) + } assert.Equal(t, tc.Want, m.version) }) } } -func TestMessage_SetData(t *testing.T) { +func TestMessage_SetRawSDValue(t *testing.T) { + cases := map[string]struct { + In string + Want string + }{ + "valid": { + In: `[value@1 foo="bar"]`, + Want: `[value@1 foo="bar"]`, + }, + "nil-value": { + In: "-", + }, + "empty": { + In: "", + }, + } + + for name, tc := range cases { + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + + var m message + + m.setRawSDValue(tc.In) + + assert.Equal(t, tc.Want, m.rawSDValue) + }) + + } +} + +func TestParseStructuredData(t *testing.T) { tests := map[string]struct { - Data map[string]map[string]string - InID string - InKey string - InValue string - Want map[string]map[string]string + In string + Want map[string]interface{} }{ - "ok": { - Data: map[string]map[string]string{ - "A": {}, + "basic": { + In: `[value@1 foo="bar"]`, + Want: map[string]interface{}{ + "value@1": map[string]interface{}{ + "foo": "bar", + }, }, - InID: "A", - InKey: "B", - InValue: "foobar", - Want: map[string]map[string]string{ - "A": { - "B": "foobar", + }, + "multi-key": { + In: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + Want: map[string]interface{}{ + "exampleSDID@32473": map[string]interface{}{ + "iut": "3", + "eventSource": "Application", + "eventID": "1011", + }, + "examplePriority@32473": map[string]interface{}{ + "class": "high", }, }, }, - "overwrite": { - Data: map[string]map[string]string{ - "A": { - "B": "C", + "repeated-id": { + In: `[exampleSDID@32473 iut="3"][exampleSDID@32473 class="high"]`, + Want: map[string]interface{}{ + "exampleSDID@32473": map[string]interface{}{ + "iut": "3", + "class": "high", }, }, - InID: "A", - InKey: "B", - InValue: "foobar", - Want: map[string]map[string]string{ - "A": { - "B": "foobar", + }, + "repeated-id-value": { + In: `[exampleSDID@32473 class="low"][exampleSDID@32473 class="high"]`, + Want: map[string]interface{}{ + "exampleSDID@32473": map[string]interface{}{ + "class": "high", }, }, }, - "missing-id": { - Data: map[string]map[string]string{}, - InID: "A", - InKey: "B", - InValue: "foobar", - Want: map[string]map[string]string{}, + "non-compliant": { + In: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + Want: nil, + }, + "empty-string": { + In: ``, + Want: nil, + }, + "nil-value": { + In: `-`, + Want: nil, }, } @@ -455,13 +539,10 @@ func TestMessage_SetData(t *testing.T) { tc := tc t.Run(name, func(t *testing.T) { t.Parallel() - m := message{ - structuredData: tc.Data, - } - m.setDataValue(tc.InID, tc.InKey, tc.InValue) + got := parseStructuredData(tc.In) - assert.Equal(t, tc.Want, m.structuredData) + assert.Equal(t, tc.Want, got) }) } } @@ -473,21 +554,17 @@ func TestMessage_Fields(t *testing.T) { }{ "valid": { In: &message{ - timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456-06:00", nil), - facility: 1, - severity: 5, - priority: 13, - hostname: "test-host", - msg: "this is a test message", - process: "su", - pid: "1024", - msgID: "msg123", - version: 1, - structuredData: map[string]map[string]string{ - "a": { - "b": "c", - }, - }, + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456-06:00", nil), + facility: 1, + severity: 5, + priority: 13, + hostname: "test-host", + msg: "this is a test message", + process: "su", + pid: "1024", + msgID: "msg123", + version: 1, + rawSDValue: `[a b="c"]`, }, Want: mapstr.M{ "log": mapstr.M{ @@ -506,8 +583,8 @@ func TestMessage_Fields(t *testing.T) { "procid": "1024", "msgid": "msg123", "version": "1", - "structured_data": map[string]map[string]string{ - "a": { + "structured_data": map[string]interface{}{ + "a": map[string]interface{}{ "b": "c", }, }, @@ -516,6 +593,77 @@ func TestMessage_Fields(t *testing.T) { "message": "this is a test message", }, }, + "non-compliant-sd": { + In: &message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456-06:00", nil), + facility: 1, + severity: 5, + priority: 13, + hostname: "test-host", + process: "su", + pid: "1024", + msgID: "msg123", + version: 1, + rawSDValue: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + }, + Want: mapstr.M{ + "log": mapstr.M{ + "syslog": mapstr.M{ + "priority": 13, + "facility": mapstr.M{ + "code": 1, + "name": "user-level", + }, + "severity": mapstr.M{ + "code": 5, + "name": "Notice", + }, + "hostname": "test-host", + "appname": "su", + "procid": "1024", + "msgid": "msg123", + "version": 1, + }, + }, + "message": `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + }, + }, + "non-compliant-sd-with-msg": { + In: &message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456-06:00", nil), + facility: 1, + severity: 5, + priority: 13, + hostname: "test-host", + process: "su", + pid: "1024", + msgID: "msg123", + version: 1, + msg: "This is a test message", + rawSDValue: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + }, + Want: mapstr.M{ + "log": mapstr.M{ + "syslog": mapstr.M{ + "priority": 13, + "facility": mapstr.M{ + "code": 1, + "name": "user-level", + }, + "severity": mapstr.M{ + "code": 5, + "name": "Notice", + }, + "hostname": "test-host", + "appname": "su", + "procid": "1024", + "msgid": "msg123", + "version": 1, + }, + }, + "message": `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"] This is a test message`, + }, + }, } for name, tc := range cases { diff --git a/libbeat/reader/syslog/parser/common.rl b/libbeat/reader/syslog/parser/common.rl index 5501c089f6bb..5bfac6bd588c 100644 --- a/libbeat/reader/syslog/parser/common.rl +++ b/libbeat/reader/syslog/parser/common.rl @@ -6,15 +6,21 @@ } action set_priority { - m.setPriority(data[tok:p]) + if err := m.setPriority(data[tok:p]); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok+1}) + } } action set_timestamp_rfc3339 { - m.setTimestampRFC3339(data[tok:p]) + if err := m.setTimestampRFC3339(data[tok:p]); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok+1}) + } } action set_timestamp_bsd { - m.setTimestampBSD(data[tok:p], loc) + if err := m.setTimestampBSD(data[tok:p], loc); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok+1}) + } } action set_hostname { @@ -33,46 +39,17 @@ m.setPID(data[tok:p]) } - action err_priority { - err = ErrPriority - fhold; - } - - action err_timestamp { - err = ErrTimestamp - fhold; - } - - action err_hostname { - err = ErrHostname + action err_eof { + errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p+1}) fhold; } sp = ' '; # space - dq = '"'; # double quote bs = 0x5C; # backslash - # Date/Time patterns - year = digit{4}; - month = ('0' . '1'..'9' | '1' . '0'..'2'); - month_str = ('Jan' | 'Feb' | 'Mar' | 'Apr' | 'May' | 'Jun' | 'Jul' | 'Aug' | 'Sep' | 'Oct' | 'Nov' | 'Dec'); - day = ('0' . '1'..'9' | '1'..'2' . '0'..'9' | '3' . '0'..'1'); - day_nopad = (sp . '1'..'9' | '1'..'2' . '0'..'9' | '3' . '0'..'1'); - hour = ('0'..'1' . '0'..'9' | '2' . '0'..'3'); - minute = ('0'..'5' . '0'..'9'); - second = ('0'..'5' . '0'..'9'); - ts_hhmmss = hour ':' minute ':' second; - ts_yyyymmdd = year '-' month '-' day; - ts_offset = 'Z' | ('+' | '-') hour ':' minute; - - # Priority - pri_range = ('1' ('9' ('0' | '1')? | '0'..'8' ('0'..'9')?)?) | ('2'..'9' ('0'..'9')?) | '0'; - pri = ('<' pri_range >tok %set_priority '>') @err(err_priority); - - # Timestamp - timestamp_rfc3339 = (ts_yyyymmdd 'T' ts_hhmmss ('.' digit{1,6})? ts_offset) >tok %set_timestamp_rfc3339 $err(err_timestamp); - timestamp_bsd = (month_str . sp . (day_nopad|day) . sp . ts_hhmmss) >tok %set_timestamp_bsd $err(err_timestamp); + priority_value = graph+ >tok %set_priority; + priority = '<' priority_value '>'; - # Hostname - hostname_range = graph{1,255}; + timestamp_bsd = (alpha+ sp+ digit+ sp+ digit+ ':' digit+ ':' digit+) >tok %set_timestamp_bsd; + timestamp_rfc3339 = (digit+ (alnum | [:.+\-]))+ >tok %set_timestamp_rfc3339; }%% diff --git a/libbeat/reader/syslog/parser/parser_rfc3164.rl b/libbeat/reader/syslog/parser/parser_rfc3164.rl index e5c90c7288f5..0f7fc7810ddc 100644 --- a/libbeat/reader/syslog/parser/parser_rfc3164.rl +++ b/libbeat/reader/syslog/parser/parser_rfc3164.rl @@ -3,6 +3,8 @@ package syslog import ( "time" + + "go.uber.org/multierr" ) %%{ @@ -14,26 +16,24 @@ import ( // parseRFC3164 parses an RFC 3164-formatted syslog message. loc is used to enrich // timestamps that lack a time zone. func parseRFC3164(data string, loc *time.Location) (message, error) { - var m message - var err error + var errs error var p, cs, tok int pe := len(data) eof := len(data) + m := message{ + priority: -1, + } %%{ include common "common.rl"; include rfc3164 "rfc3164.rl"; - main := pri timestamp sp hostname sp msg; + main := (priority? timestamp sp hostname sp msg) $err(err_eof); write init; write exec; }%% - if err != nil { - return message{}, err - } - - return m, nil + return m, errs } diff --git a/libbeat/reader/syslog/parser/parser_rfc5424.rl b/libbeat/reader/syslog/parser/parser_rfc5424.rl index 92cfbce133f8..36e494278dc3 100644 --- a/libbeat/reader/syslog/parser/parser_rfc5424.rl +++ b/libbeat/reader/syslog/parser/parser_rfc5424.rl @@ -1,6 +1,8 @@ // Code generated by ragel. DO NOT EDIT. package syslog +import "go.uber.org/multierr" + %%{ machine rfc5424; @@ -15,29 +17,26 @@ type machineState struct { // ParseRFC5424 parses an RFC 5424-formatted syslog message. func parseRFC5424(data string) (message, error) { - var m message - var s machineState - var err error + var errs error var p, cs, tok int pe := len(data) eof := len(data) + m := message{ + priority: -1, + } %%{ include common "common.rl"; include rfc5424 "rfc5424.rl"; - main := header sp structured_data (sp msg)?; + main := (header sp sd_raw (sp msg)?) $err(err_eof); write init; write exec; }%% - if err != nil { - return message{}, err - } - - return m, nil + return m, errs } %%{ @@ -61,7 +60,7 @@ func isRFC5424(data string) bool { include common "common.rl"; include rfc5424 "rfc5424.rl"; - main := "<" pri_range ">" version_range sp digit{4} >set_true; + main := "<" digit+ ">" digit+ sp digit{4} >set_true; write init; write exec; @@ -69,3 +68,42 @@ func isRFC5424(data string) bool { return isRFC5424 } + +%%{ + machine parse_sd; + + write data; +}%% + +// parseStructuredData performs a best effort parsing of the raw structured data value +// extracted from the syslog message. If the raw structured data value is an empty +// string or the nil value ('-'), nil is returned. Otherwise, the value is parsed +// using the format defined by RFC 5424. If the value cannot be parsed, then nil +// is returned. +func parseStructuredData(data string) map[string]interface{} { + var s machineState + var p, cs, tok int + + pe := len(data) + structuredData := map[string]interface{}{} + + if data == "" || data == "-" { + return nil + } + + %%{ + include common "common.rl"; + include rfc5424 "rfc5424.rl"; + + main := structured_data; + + write init; + write exec; + }%% + + if len(structuredData) == 0 { + return nil + } + + return structuredData +} diff --git a/libbeat/reader/syslog/parser/rfc3164.rl b/libbeat/reader/syslog/parser/rfc3164.rl index 8108e8eb0872..0dac77314040 100644 --- a/libbeat/reader/syslog/parser/rfc3164.rl +++ b/libbeat/reader/syslog/parser/rfc3164.rl @@ -13,9 +13,9 @@ } timestamp = (timestamp_rfc3339 | timestamp_bsd); - hostname = hostname_range >tok %set_hostname $err(err_hostname); + hostname = graph+ >tok %set_hostname; - tag = (print -- [ :\[]){1,32} >tok %set_tag; + tag = (print -- [ :\[])+ >tok %set_tag; content_value = print+ >tok %set_content; content = '[' content_value ']'; msg = (tag content? ':' sp)? any+ >tok %set_msg; diff --git a/libbeat/reader/syslog/parser/rfc5424.rl b/libbeat/reader/syslog/parser/rfc5424.rl index 671637b732c2..e00d820d8108 100644 --- a/libbeat/reader/syslog/parser/rfc5424.rl +++ b/libbeat/reader/syslog/parser/rfc5424.rl @@ -17,11 +17,13 @@ } action set_version { - m.setVersion(data[tok:p]) + if err := m.setVersion(data[tok:p]); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok+1}) + } } - action init_sd_data { - m.structuredData = map[string]map[string]string{} + action set_sd_raw { + m.setRawSDValue(data[tok:p]) } action init_sd_escapes { @@ -33,16 +35,15 @@ } action set_param_value { - m.setDataValue(s.sdID, s.sdParamName, removeBytes(data[tok:p], s.sdValueEscapes, p)) + if subMap, ok := structuredData[s.sdID].(map[string]interface{}); ok { + subMap[s.sdParamName] = removeBytes(data[tok:p], s.sdValueEscapes, p) + } } action set_sd_id { s.sdID = data[tok:p] - if _, ok := m.structuredData[s.sdID]; ok { - err = ErrSDIDDuplicated - fhold; - } else { - m.structuredData[s.sdID] = map[string]string{} + if _, ok := structuredData[s.sdID]; !ok { + structuredData[s.sdID] = map[string]interface{}{} } } @@ -50,74 +51,29 @@ s.sdValueEscapes = append(s.sdValueEscapes, p) } - action err_version { - err = ErrVersion - fhold; - } - - action err_app_name { - err = ErrAppName - fhold; - } - - action err_proc_id { - err = ErrProcID - fhold; - } - - action err_msg_id { - err = ErrMsgID - fhold; - } - - action err_structured_data { - err = ErrStructuredData - fhold; - } - - action err_sd_id { - err = ErrSDID - fhold; - } - - action err_sd_param { - err = ErrSDParam - fhold; - } - nil_value = '-'; - version_range = ('1'..'9' . digit{0,2}); - version = version_range >tok %set_version @err(err_version); + version = graph+ > tok %set_version; escape_chars = ('"' | ']' | bs); param_value_escape = (bs >set_escape escape_chars); sd_name = (graph - ('=' | ']' | '"' | sp)){1,32}; param_name = sd_name >tok %set_param_name; param_value = ((any - escape_chars) | param_value_escape)+ >tok %set_param_value; - sd_param = param_name '=' '"' param_value '"' >init_sd_escapes $err(err_sd_param); - sd_id = sd_name >tok %set_sd_id %err(err_sd_id) $err(err_sd_id); + sd_param = param_name '=' '"' param_value '"' >init_sd_escapes; + sd_id = sd_name >tok %set_sd_id; sd_element = '[' sd_id (sp sd_param)* ']'; - structured_data = nil_value | sd_element+ >init_sd_data $err(err_structured_data); - - hostname_value = hostname_range >tok %set_hostname $err(err_hostname); - hostname = nil_value | hostname_value; - - app_name_range = graph{1,48}; - app_name_value = app_name_range >tok %set_app_name $err(err_app_name); - app_name = nil_value | app_name_value; - - proc_id_range = graph{1,128}; - proc_id_value = proc_id_range >tok %set_proc_id $err(err_proc_id); - proc_id = nil_value | proc_id_value; + structured_data = sd_element+; + timestamp = nil_value | timestamp_rfc3339; - msg_id_range = graph{1,32}; - msg_id_value = msg_id_range >tok %set_msg_id $err(err_msg_id); - msg_id = nil_value | msg_id_value; + hostname = nil_value | graph+ >tok %set_hostname; + app_name = nil_value | graph+ >tok %set_app_name; + proc_id = nil_value | graph+ >tok %set_proc_id; + msg_id = nil_value | graph+ >tok %set_msg_id; - timestamp = nil_value | timestamp_rfc3339; + header = priority version sp timestamp sp hostname sp app_name sp proc_id sp msg_id; - header = pri version sp timestamp sp hostname sp app_name sp proc_id sp msg_id; + sd_raw = nil_value | ('[' any+ ']') >tok %set_sd_raw; msg = any* >tok %set_msg; }%% diff --git a/libbeat/reader/syslog/rfc3164_gen.go b/libbeat/reader/syslog/rfc3164_gen.go index c29d77b6601b..c6e756bc221a 100644 --- a/libbeat/reader/syslog/rfc3164_gen.go +++ b/libbeat/reader/syslog/rfc3164_gen.go @@ -21,33 +21,37 @@ package syslog import ( "time" + + "go.uber.org/multierr" ) -//line rfc3164_gen.go:12 +//line rfc3164_gen.go:14 const rfc3164_parser_start int = 1 -const rfc3164_parser_first_final int = 336 +const rfc3164_parser_first_final int = 24 const rfc3164_parser_error int = 0 const rfc3164_parser_en_main int = 1 -//line parser/parser_rfc3164.rl:12 +//line parser/parser_rfc3164.rl:14 // parseRFC3164 parses an RFC 3164-formatted syslog message. loc is used to enrich // timestamps that lack a time zone. func parseRFC3164(data string, loc *time.Location) (message, error) { - var m message - var err error + var errs error var p, cs, tok int pe := len(data) eof := len(data) + m := message{ + priority: -1, + } -//line rfc3164_gen.go:34 +//line rfc3164_gen.go:38 { cs = rfc3164_parser_start } -//line rfc3164_gen.go:39 +//line rfc3164_gen.go:43 { if p == pe { goto _test_eof @@ -67,6 +71,24 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto st_case_5 case 6: goto st_case_6 + case 24: + goto st_case_24 + case 25: + goto st_case_25 + case 26: + goto st_case_26 + case 27: + goto st_case_27 + case 28: + goto st_case_28 + case 29: + goto st_case_29 + case 30: + goto st_case_30 + case 31: + goto st_case_31 + case 32: + goto st_case_32 case 7: goto st_case_7 case 8: @@ -101,778 +123,99 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto st_case_22 case 23: goto st_case_23 - case 24: - goto st_case_24 - case 25: - goto st_case_25 - case 26: - goto st_case_26 - case 27: - goto st_case_27 - case 28: - goto st_case_28 - case 29: - goto st_case_29 - case 30: - goto st_case_30 - case 31: - goto st_case_31 - case 32: - goto st_case_32 - case 336: - goto st_case_336 - case 337: - goto st_case_337 - case 338: - goto st_case_338 - case 339: - goto st_case_339 - case 340: - goto st_case_340 - case 341: - goto st_case_341 - case 342: - goto st_case_342 - case 343: - goto st_case_343 - case 344: - goto st_case_344 - case 345: - goto st_case_345 - case 346: - goto st_case_346 - case 347: - goto st_case_347 - case 348: - goto st_case_348 - case 349: - goto st_case_349 - case 350: - goto st_case_350 - case 351: - goto st_case_351 - case 352: - goto st_case_352 - case 353: - goto st_case_353 - case 354: - goto st_case_354 - case 355: - goto st_case_355 - case 356: - goto st_case_356 - case 357: - goto st_case_357 - case 358: - goto st_case_358 - case 359: - goto st_case_359 - case 360: - goto st_case_360 - case 361: - goto st_case_361 - case 362: - goto st_case_362 - case 363: - goto st_case_363 - case 364: - goto st_case_364 - case 365: - goto st_case_365 - case 366: - goto st_case_366 - case 367: - goto st_case_367 - case 368: - goto st_case_368 - case 369: - goto st_case_369 - case 370: - goto st_case_370 - case 371: - goto st_case_371 - case 372: - goto st_case_372 - case 373: - goto st_case_373 - case 374: - goto st_case_374 - case 375: - goto st_case_375 - case 33: - goto st_case_33 - case 34: - goto st_case_34 - case 35: - goto st_case_35 - case 36: - goto st_case_36 - case 37: - goto st_case_37 - case 38: - goto st_case_38 - case 39: - goto st_case_39 - case 40: - goto st_case_40 - case 41: - goto st_case_41 - case 42: - goto st_case_42 - case 43: - goto st_case_43 - case 44: - goto st_case_44 - case 45: - goto st_case_45 - case 46: - goto st_case_46 - case 47: - goto st_case_47 - case 48: - goto st_case_48 - case 49: - goto st_case_49 - case 50: - goto st_case_50 - case 51: - goto st_case_51 - case 52: - goto st_case_52 - case 53: - goto st_case_53 - case 54: - goto st_case_54 - case 55: - goto st_case_55 - case 56: - goto st_case_56 - case 57: - goto st_case_57 - case 58: - goto st_case_58 - case 59: - goto st_case_59 - case 60: - goto st_case_60 - case 61: - goto st_case_61 - case 62: - goto st_case_62 - case 63: - goto st_case_63 - case 64: - goto st_case_64 - case 65: - goto st_case_65 - case 66: - goto st_case_66 - case 67: - goto st_case_67 - case 68: - goto st_case_68 - case 69: - goto st_case_69 - case 70: - goto st_case_70 - case 71: - goto st_case_71 - case 72: - goto st_case_72 - case 73: - goto st_case_73 - case 74: - goto st_case_74 - case 75: - goto st_case_75 - case 76: - goto st_case_76 - case 77: - goto st_case_77 - case 78: - goto st_case_78 - case 79: - goto st_case_79 - case 80: - goto st_case_80 - case 81: - goto st_case_81 - case 82: - goto st_case_82 - case 83: - goto st_case_83 - case 84: - goto st_case_84 - case 85: - goto st_case_85 - case 86: - goto st_case_86 - case 87: - goto st_case_87 - case 88: - goto st_case_88 - case 89: - goto st_case_89 - case 90: - goto st_case_90 - case 91: - goto st_case_91 - case 92: - goto st_case_92 - case 93: - goto st_case_93 - case 94: - goto st_case_94 - case 95: - goto st_case_95 - case 96: - goto st_case_96 - case 97: - goto st_case_97 - case 98: - goto st_case_98 - case 99: - goto st_case_99 - case 100: - goto st_case_100 - case 101: - goto st_case_101 - case 102: - goto st_case_102 - case 103: - goto st_case_103 - case 104: - goto st_case_104 - case 105: - goto st_case_105 - case 106: - goto st_case_106 - case 107: - goto st_case_107 - case 108: - goto st_case_108 - case 109: - goto st_case_109 - case 110: - goto st_case_110 - case 111: - goto st_case_111 - case 112: - goto st_case_112 - case 113: - goto st_case_113 - case 114: - goto st_case_114 - case 115: - goto st_case_115 - case 116: - goto st_case_116 - case 117: - goto st_case_117 - case 118: - goto st_case_118 - case 119: - goto st_case_119 - case 120: - goto st_case_120 - case 121: - goto st_case_121 - case 122: - goto st_case_122 - case 123: - goto st_case_123 - case 124: - goto st_case_124 - case 125: - goto st_case_125 - case 126: - goto st_case_126 - case 127: - goto st_case_127 - case 128: - goto st_case_128 - case 129: - goto st_case_129 - case 130: - goto st_case_130 - case 131: - goto st_case_131 - case 132: - goto st_case_132 - case 133: - goto st_case_133 - case 134: - goto st_case_134 - case 135: - goto st_case_135 - case 136: - goto st_case_136 - case 137: - goto st_case_137 - case 138: - goto st_case_138 - case 139: - goto st_case_139 - case 140: - goto st_case_140 - case 141: - goto st_case_141 - case 142: - goto st_case_142 - case 143: - goto st_case_143 - case 144: - goto st_case_144 - case 145: - goto st_case_145 - case 146: - goto st_case_146 - case 147: - goto st_case_147 - case 148: - goto st_case_148 - case 149: - goto st_case_149 - case 150: - goto st_case_150 - case 151: - goto st_case_151 - case 152: - goto st_case_152 - case 153: - goto st_case_153 - case 154: - goto st_case_154 - case 155: - goto st_case_155 - case 156: - goto st_case_156 - case 157: - goto st_case_157 - case 158: - goto st_case_158 - case 159: - goto st_case_159 - case 160: - goto st_case_160 - case 161: - goto st_case_161 - case 162: - goto st_case_162 - case 163: - goto st_case_163 - case 164: - goto st_case_164 - case 165: - goto st_case_165 - case 166: - goto st_case_166 - case 167: - goto st_case_167 - case 168: - goto st_case_168 - case 169: - goto st_case_169 - case 170: - goto st_case_170 - case 171: - goto st_case_171 - case 172: - goto st_case_172 - case 173: - goto st_case_173 - case 174: - goto st_case_174 - case 175: - goto st_case_175 - case 176: - goto st_case_176 - case 177: - goto st_case_177 - case 178: - goto st_case_178 - case 179: - goto st_case_179 - case 180: - goto st_case_180 - case 181: - goto st_case_181 - case 182: - goto st_case_182 - case 183: - goto st_case_183 - case 184: - goto st_case_184 - case 185: - goto st_case_185 - case 186: - goto st_case_186 - case 187: - goto st_case_187 - case 188: - goto st_case_188 - case 189: - goto st_case_189 - case 190: - goto st_case_190 - case 191: - goto st_case_191 - case 192: - goto st_case_192 - case 193: - goto st_case_193 - case 194: - goto st_case_194 - case 195: - goto st_case_195 - case 196: - goto st_case_196 - case 197: - goto st_case_197 - case 198: - goto st_case_198 - case 199: - goto st_case_199 - case 200: - goto st_case_200 - case 201: - goto st_case_201 - case 202: - goto st_case_202 - case 203: - goto st_case_203 - case 204: - goto st_case_204 - case 205: - goto st_case_205 - case 206: - goto st_case_206 - case 207: - goto st_case_207 - case 208: - goto st_case_208 - case 209: - goto st_case_209 - case 210: - goto st_case_210 - case 211: - goto st_case_211 - case 212: - goto st_case_212 - case 213: - goto st_case_213 - case 214: - goto st_case_214 - case 215: - goto st_case_215 - case 216: - goto st_case_216 - case 217: - goto st_case_217 - case 218: - goto st_case_218 - case 219: - goto st_case_219 - case 220: - goto st_case_220 - case 221: - goto st_case_221 - case 222: - goto st_case_222 - case 223: - goto st_case_223 - case 224: - goto st_case_224 - case 225: - goto st_case_225 - case 226: - goto st_case_226 - case 227: - goto st_case_227 - case 228: - goto st_case_228 - case 229: - goto st_case_229 - case 230: - goto st_case_230 - case 231: - goto st_case_231 - case 232: - goto st_case_232 - case 233: - goto st_case_233 - case 234: - goto st_case_234 - case 235: - goto st_case_235 - case 236: - goto st_case_236 - case 237: - goto st_case_237 - case 238: - goto st_case_238 - case 239: - goto st_case_239 - case 240: - goto st_case_240 - case 241: - goto st_case_241 - case 242: - goto st_case_242 - case 243: - goto st_case_243 - case 244: - goto st_case_244 - case 245: - goto st_case_245 - case 246: - goto st_case_246 - case 247: - goto st_case_247 - case 248: - goto st_case_248 - case 249: - goto st_case_249 - case 250: - goto st_case_250 - case 251: - goto st_case_251 - case 252: - goto st_case_252 - case 253: - goto st_case_253 - case 254: - goto st_case_254 - case 255: - goto st_case_255 - case 256: - goto st_case_256 - case 257: - goto st_case_257 - case 258: - goto st_case_258 - case 259: - goto st_case_259 - case 260: - goto st_case_260 - case 261: - goto st_case_261 - case 262: - goto st_case_262 - case 263: - goto st_case_263 - case 264: - goto st_case_264 - case 265: - goto st_case_265 - case 266: - goto st_case_266 - case 267: - goto st_case_267 - case 268: - goto st_case_268 - case 269: - goto st_case_269 - case 270: - goto st_case_270 - case 271: - goto st_case_271 - case 272: - goto st_case_272 - case 273: - goto st_case_273 - case 274: - goto st_case_274 - case 275: - goto st_case_275 - case 276: - goto st_case_276 - case 277: - goto st_case_277 - case 278: - goto st_case_278 - case 279: - goto st_case_279 - case 280: - goto st_case_280 - case 281: - goto st_case_281 - case 282: - goto st_case_282 - case 283: - goto st_case_283 - case 284: - goto st_case_284 - case 285: - goto st_case_285 - case 286: - goto st_case_286 - case 287: - goto st_case_287 - case 288: - goto st_case_288 - case 289: - goto st_case_289 - case 290: - goto st_case_290 - case 291: - goto st_case_291 - case 292: - goto st_case_292 - case 293: - goto st_case_293 - case 294: - goto st_case_294 - case 295: - goto st_case_295 - case 296: - goto st_case_296 - case 297: - goto st_case_297 - case 298: - goto st_case_298 - case 299: - goto st_case_299 - case 300: - goto st_case_300 - case 301: - goto st_case_301 - case 302: - goto st_case_302 - case 303: - goto st_case_303 - case 304: - goto st_case_304 - case 305: - goto st_case_305 - case 306: - goto st_case_306 - case 307: - goto st_case_307 - case 308: - goto st_case_308 - case 309: - goto st_case_309 - case 310: - goto st_case_310 - case 311: - goto st_case_311 - case 312: - goto st_case_312 - case 313: - goto st_case_313 - case 314: - goto st_case_314 - case 315: - goto st_case_315 - case 316: - goto st_case_316 - case 317: - goto st_case_317 - case 318: - goto st_case_318 - case 319: - goto st_case_319 - case 320: - goto st_case_320 - case 321: - goto st_case_321 - case 322: - goto st_case_322 - case 323: - goto st_case_323 - case 324: - goto st_case_324 - case 325: - goto st_case_325 - case 326: - goto st_case_326 - case 327: - goto st_case_327 - case 328: - goto st_case_328 - case 329: - goto st_case_329 - case 330: - goto st_case_330 - case 331: - goto st_case_331 - case 332: - goto st_case_332 - case 333: - goto st_case_333 - case 334: - goto st_case_334 - case 335: - goto st_case_335 } goto st_out st_case_1: if data[p] == 60 { - goto st2 + goto st8 + } + switch { + case data[p] < 65: + if 48 <= data[p] && data[p] <= 57 { + goto tr1 + } + case data[p] > 90: + if 97 <= data[p] && data[p] <= 122 { + goto tr3 + } + default: + goto tr3 } goto tr0 tr0: -//line parser/common.rl:36 - - err = ErrPriority - p-- - - goto st0 - tr6: -//line parser/common.rl:41 - - err = ErrTimestamp - p-- +//line parser/common.rl:42 - goto st0 - tr47: -//line parser/common.rl:46 - - err = ErrHostname + errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) p-- goto st0 -//line rfc3164_gen.go:828 +//line rfc3164_gen.go:142 st_case_0: st0: cs = 0 goto _out + tr1: +//line parser/common.rl:4 + + tok = p + + goto st2 st2: if p++; p == pe { goto _test_eof2 } st_case_2: +//line rfc3164_gen.go:158 switch data[p] { - case 48: - goto tr2 - case 49: - goto tr3 + case 43: + goto st3 + case 58: + goto st3 } - if 50 <= data[p] && data[p] <= 57 { - goto tr4 + switch { + case data[p] < 48: + if 45 <= data[p] && data[p] <= 46 { + goto st3 + } + case data[p] > 57: + switch { + case data[p] > 90: + if 97 <= data[p] && data[p] <= 122 { + goto st3 + } + case data[p] >= 65: + goto st3 + } + default: + goto st7 } goto tr0 - tr2: -//line parser/common.rl:4 - - tok = p - - goto st3 st3: if p++; p == pe { goto _test_eof3 } st_case_3: -//line rfc3164_gen.go:859 - if data[p] == 62 { - goto tr5 + if data[p] == 32 { + goto tr6 + } + if 48 <= data[p] && data[p] <= 57 { + goto st2 } goto tr0 - tr5: -//line parser/common.rl:8 + tr6: +//line parser/common.rl:14 + + if err := m.setTimestampRFC3339(data[tok:p]); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + } + + goto st4 + tr30: +//line parser/common.rl:20 - m.setPriority(data[tok:p]) + if err := m.setTimestampBSD(data[tok:p], loc); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + } goto st4 st4: @@ -880,30 +223,12 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof4 } st_case_4: -//line rfc3164_gen.go:875 - switch data[p] { - case 65: +//line rfc3164_gen.go:216 + if 33 <= data[p] && data[p] <= 126 { goto tr8 - case 68: - goto tr9 - case 70: - goto tr10 - case 74: - goto tr11 - case 77: - goto tr12 - case 78: - goto tr13 - case 79: - goto tr14 - case 83: - goto tr15 - } - if 48 <= data[p] && data[p] <= 57 { - goto tr7 } - goto tr6 - tr7: + goto tr0 + tr8: //line parser/common.rl:4 tok = p @@ -914,5686 +239,680 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof5 } st_case_5: -//line rfc3164_gen.go:909 - if 48 <= data[p] && data[p] <= 57 { - goto st6 +//line rfc3164_gen.go:232 + if data[p] == 32 { + goto tr9 + } + if 33 <= data[p] && data[p] <= 126 { + goto st5 } - goto tr6 + goto tr0 + tr9: +//line parser/common.rl:26 + + m.setHostname(data[tok:p]) + + goto st6 st6: if p++; p == pe { goto _test_eof6 } st_case_6: - if 48 <= data[p] && data[p] <= 57 { - goto st7 +//line rfc3164_gen.go:251 + switch { + case data[p] < 59: + if 33 <= data[p] && data[p] <= 57 { + goto tr12 + } + case data[p] > 90: + if 92 <= data[p] && data[p] <= 126 { + goto tr12 + } + default: + goto tr12 } - goto tr6 - st7: + goto tr11 + tr11: +//line parser/common.rl:4 + + tok = p + + goto st24 + st24: if p++; p == pe { - goto _test_eof7 - } - st_case_7: - if 48 <= data[p] && data[p] <= 57 { - goto st8 + goto _test_eof24 } - goto tr6 - st8: + st_case_24: +//line rfc3164_gen.go:276 + goto st24 + tr12: +//line parser/common.rl:4 + + tok = p + + goto st25 + st25: if p++; p == pe { - goto _test_eof8 + goto _test_eof25 } - st_case_8: - if data[p] == 45 { - goto st9 + st_case_25: +//line rfc3164_gen.go:289 + switch data[p] { + case 58: + goto tr34 + case 91: + goto tr35 } - goto tr6 - st9: + if 33 <= data[p] && data[p] <= 126 { + goto st25 + } + goto st24 + tr34: +//line parser/rfc3164.rl:7 + + m.setTag(data[tok:p]) + + goto st26 + st26: if p++; p == pe { - goto _test_eof9 + goto _test_eof26 } - st_case_9: - switch data[p] { - case 48: - goto st10 - case 49: - goto st298 + st_case_26: +//line rfc3164_gen.go:311 + if data[p] == 32 { + goto st27 } - goto tr6 - st10: + goto st24 + st27: if p++; p == pe { - goto _test_eof10 - } - st_case_10: - if 49 <= data[p] && data[p] <= 57 { - goto st11 + goto _test_eof27 } - goto tr6 - st11: + st_case_27: + goto tr11 + tr35: +//line parser/rfc3164.rl:7 + + m.setTag(data[tok:p]) + + goto st28 + st28: if p++; p == pe { - goto _test_eof11 + goto _test_eof28 } - st_case_11: - if data[p] == 45 { - goto st12 + st_case_28: +//line rfc3164_gen.go:333 + if 32 <= data[p] && data[p] <= 126 { + goto tr37 } - goto tr6 - st12: + goto st24 + tr37: +//line parser/common.rl:4 + + tok = p + + goto st29 + st29: if p++; p == pe { - goto _test_eof12 + goto _test_eof29 } - st_case_12: - switch data[p] { - case 48: - goto st13 - case 51: - goto st297 + st_case_29: +//line rfc3164_gen.go:349 + if data[p] == 93 { + goto tr39 } - if 49 <= data[p] && data[p] <= 50 { - goto st296 + if 32 <= data[p] && data[p] <= 126 { + goto st29 } - goto tr6 - st13: + goto st24 + tr39: +//line parser/rfc3164.rl:11 + + m.setContent(data[tok:p]) + + goto st30 + tr42: +//line parser/rfc3164.rl:11 + + m.setContent(data[tok:p]) + +//line parser/common.rl:4 + + tok = p + + goto st30 + st30: if p++; p == pe { - goto _test_eof13 + goto _test_eof30 } - st_case_13: - if 49 <= data[p] && data[p] <= 57 { - goto st14 + st_case_30: +//line rfc3164_gen.go:378 + switch data[p] { + case 58: + goto st31 + case 93: + goto tr39 } - goto tr6 - st14: + if 32 <= data[p] && data[p] <= 126 { + goto st29 + } + goto st24 + st31: if p++; p == pe { - goto _test_eof14 + goto _test_eof31 } - st_case_14: - if data[p] == 84 { - goto st15 + st_case_31: + switch data[p] { + case 32: + goto st32 + case 93: + goto tr39 } - goto tr6 - st15: + if 33 <= data[p] && data[p] <= 126 { + goto st29 + } + goto st24 + st32: if p++; p == pe { - goto _test_eof15 + goto _test_eof32 } - st_case_15: - if data[p] == 50 { - goto st295 + st_case_32: + if data[p] == 93 { + goto tr42 } - if 48 <= data[p] && data[p] <= 49 { - goto st16 + if 32 <= data[p] && data[p] <= 126 { + goto tr37 } - goto tr6 - st16: + goto tr11 + st7: if p++; p == pe { - goto _test_eof16 + goto _test_eof7 } - st_case_16: - if 48 <= data[p] && data[p] <= 57 { - goto st17 - } - goto tr6 - st17: - if p++; p == pe { - goto _test_eof17 - } - st_case_17: - if data[p] == 58 { - goto st18 - } - goto tr6 - st18: - if p++; p == pe { - goto _test_eof18 - } - st_case_18: - if 48 <= data[p] && data[p] <= 53 { - goto st19 - } - goto tr6 - st19: - if p++; p == pe { - goto _test_eof19 - } - st_case_19: - if 48 <= data[p] && data[p] <= 57 { - goto st20 - } - goto tr6 - st20: - if p++; p == pe { - goto _test_eof20 - } - st_case_20: - if data[p] == 58 { - goto st21 - } - goto tr6 - st21: - if p++; p == pe { - goto _test_eof21 - } - st_case_21: - if 48 <= data[p] && data[p] <= 53 { - goto st22 - } - goto tr6 - st22: - if p++; p == pe { - goto _test_eof22 - } - st_case_22: - if 48 <= data[p] && data[p] <= 57 { - goto st23 - } - goto tr6 - st23: - if p++; p == pe { - goto _test_eof23 - } - st_case_23: + st_case_7: switch data[p] { + case 32: + goto tr6 case 43: - goto st24 - case 45: - goto st24 - case 46: - goto st288 - case 90: - goto st29 - } - goto tr6 - st24: - if p++; p == pe { - goto _test_eof24 - } - st_case_24: - if data[p] == 50 { - goto st287 - } - if 48 <= data[p] && data[p] <= 49 { - goto st25 - } - goto tr6 - st25: - if p++; p == pe { - goto _test_eof25 - } - st_case_25: - if 48 <= data[p] && data[p] <= 57 { - goto st26 - } - goto tr6 - st26: - if p++; p == pe { - goto _test_eof26 - } - st_case_26: - if data[p] == 58 { - goto st27 - } - goto tr6 - st27: - if p++; p == pe { - goto _test_eof27 - } - st_case_27: - if 48 <= data[p] && data[p] <= 53 { - goto st28 - } - goto tr6 - st28: - if p++; p == pe { - goto _test_eof28 - } - st_case_28: - if 48 <= data[p] && data[p] <= 57 { - goto st29 - } - goto tr6 - st29: - if p++; p == pe { - goto _test_eof29 + goto st3 + case 58: + goto st3 } - st_case_29: - if data[p] == 32 { - goto tr46 + switch { + case data[p] < 48: + if 45 <= data[p] && data[p] <= 46 { + goto st3 + } + case data[p] > 57: + switch { + case data[p] > 90: + if 97 <= data[p] && data[p] <= 122 { + goto st3 + } + case data[p] >= 65: + goto st3 + } + default: + goto st7 } - goto tr6 - tr46: -//line parser/common.rl:12 - - m.setTimestampRFC3339(data[tok:p]) - - goto st30 - tr330: -//line parser/common.rl:16 - - m.setTimestampBSD(data[tok:p], loc) - - goto st30 - st30: + goto tr0 + st8: if p++; p == pe { - goto _test_eof30 + goto _test_eof8 } - st_case_30: -//line rfc3164_gen.go:1169 + st_case_8: if 33 <= data[p] && data[p] <= 126 { - goto tr48 + goto tr13 } - goto tr47 - tr48: + goto tr0 + tr13: //line parser/common.rl:4 tok = p - goto st31 - st31: + goto st9 + st9: if p++; p == pe { - goto _test_eof31 + goto _test_eof9 } - st_case_31: -//line rfc3164_gen.go:1185 - if data[p] == 32 { - goto tr49 + st_case_9: +//line rfc3164_gen.go:467 + if data[p] == 62 { + goto tr15 } if 33 <= data[p] && data[p] <= 126 { - goto st33 + goto st9 } - goto tr47 - tr49: -//line parser/common.rl:20 + goto tr0 + tr15: +//line parser/common.rl:8 - m.setHostname(data[tok:p]) + if err := m.setPriority(data[tok:p]); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + } - goto st32 - st32: + goto st10 + st10: if p++; p == pe { - goto _test_eof32 + goto _test_eof10 + } + st_case_10: +//line rfc3164_gen.go:488 + if data[p] == 62 { + goto tr15 } - st_case_32: -//line rfc3164_gen.go:1204 switch { - case data[p] < 59: - if 33 <= data[p] && data[p] <= 57 { - goto tr52 + case data[p] < 65: + switch { + case data[p] < 48: + if 33 <= data[p] && data[p] <= 47 { + goto st9 + } + case data[p] > 57: + if 58 <= data[p] && data[p] <= 64 { + goto st9 + } + default: + goto tr16 } case data[p] > 90: - if 92 <= data[p] && data[p] <= 126 { - goto tr52 + switch { + case data[p] < 97: + if 91 <= data[p] && data[p] <= 96 { + goto st9 + } + case data[p] > 122: + if 123 <= data[p] && data[p] <= 126 { + goto st9 + } + default: + goto tr17 } default: - goto tr52 + goto tr17 } - goto tr51 - tr51: -//line parser/common.rl:4 - - tok = p - - goto st336 - st336: - if p++; p == pe { - goto _test_eof336 - } - st_case_336: -//line rfc3164_gen.go:1229 - goto st336 - tr52: + goto tr0 + tr16: //line parser/common.rl:4 tok = p - goto st337 - st337: + goto st11 + st11: if p++; p == pe { - goto _test_eof337 + goto _test_eof11 } - st_case_337: -//line rfc3164_gen.go:1242 + st_case_11: +//line rfc3164_gen.go:534 switch data[p] { + case 43: + goto st12 + case 47: + goto st9 case 58: - goto tr344 - case 91: - goto tr345 + goto st12 + case 62: + goto tr15 } - if 33 <= data[p] && data[p] <= 126 { - goto st338 + switch { + case data[p] < 59: + switch { + case data[p] < 45: + if 33 <= data[p] && data[p] <= 44 { + goto st9 + } + case data[p] > 46: + if 48 <= data[p] && data[p] <= 57 { + goto st13 + } + default: + goto st12 + } + case data[p] > 64: + switch { + case data[p] < 91: + if 65 <= data[p] && data[p] <= 90 { + goto st12 + } + case data[p] > 96: + switch { + case data[p] > 122: + if 123 <= data[p] && data[p] <= 126 { + goto st9 + } + case data[p] >= 97: + goto st12 + } + default: + goto st9 + } + default: + goto st9 } - goto st336 - st338: + goto tr0 + st12: if p++; p == pe { - goto _test_eof338 + goto _test_eof12 } - st_case_338: + st_case_12: switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 + case 32: + goto tr6 + case 62: + goto tr15 } - if 33 <= data[p] && data[p] <= 126 { - goto st339 + switch { + case data[p] < 48: + if 33 <= data[p] && data[p] <= 47 { + goto st9 + } + case data[p] > 57: + if 58 <= data[p] && data[p] <= 126 { + goto st9 + } + default: + goto st11 } - goto st336 - st339: + goto tr0 + st13: if p++; p == pe { - goto _test_eof339 + goto _test_eof13 } - st_case_339: + st_case_13: switch data[p] { + case 32: + goto tr6 + case 43: + goto st12 + case 47: + goto st9 case 58: - goto tr344 - case 91: - goto tr345 + goto st12 + case 62: + goto tr15 } - if 33 <= data[p] && data[p] <= 126 { - goto st340 + switch { + case data[p] < 59: + switch { + case data[p] < 45: + if 33 <= data[p] && data[p] <= 44 { + goto st9 + } + case data[p] > 46: + if 48 <= data[p] && data[p] <= 57 { + goto st13 + } + default: + goto st12 + } + case data[p] > 64: + switch { + case data[p] < 91: + if 65 <= data[p] && data[p] <= 90 { + goto st12 + } + case data[p] > 96: + switch { + case data[p] > 122: + if 123 <= data[p] && data[p] <= 126 { + goto st9 + } + case data[p] >= 97: + goto st12 + } + default: + goto st9 + } + default: + goto st9 } - goto st336 - st340: + goto tr0 + tr17: +//line parser/common.rl:4 + + tok = p + + goto st14 + st14: if p++; p == pe { - goto _test_eof340 + goto _test_eof14 } - st_case_340: + st_case_14: +//line rfc3164_gen.go:669 switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 + case 32: + goto st15 + case 62: + goto tr15 } - if 33 <= data[p] && data[p] <= 126 { - goto st341 + switch { + case data[p] < 91: + switch { + case data[p] > 64: + if 65 <= data[p] && data[p] <= 90 { + goto st14 + } + case data[p] >= 33: + goto st9 + } + case data[p] > 96: + switch { + case data[p] > 122: + if 123 <= data[p] && data[p] <= 126 { + goto st9 + } + case data[p] >= 97: + goto st14 + } + default: + goto st9 } - goto st336 - st341: + goto tr0 + st15: if p++; p == pe { - goto _test_eof341 + goto _test_eof15 } - st_case_341: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 + st_case_15: + if data[p] == 32 { + goto st15 } - if 33 <= data[p] && data[p] <= 126 { - goto st342 + if 48 <= data[p] && data[p] <= 57 { + goto st16 } - goto st336 - st342: + goto tr0 + st16: if p++; p == pe { - goto _test_eof342 + goto _test_eof16 } - st_case_342: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 + st_case_16: + if data[p] == 32 { + goto st17 } - if 33 <= data[p] && data[p] <= 126 { - goto st343 + if 48 <= data[p] && data[p] <= 57 { + goto st16 } - goto st336 - st343: - if p++; p == pe { - goto _test_eof343 - } - st_case_343: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st344 - } - goto st336 - st344: - if p++; p == pe { - goto _test_eof344 - } - st_case_344: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st345 - } - goto st336 - st345: - if p++; p == pe { - goto _test_eof345 - } - st_case_345: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st346 - } - goto st336 - st346: - if p++; p == pe { - goto _test_eof346 - } - st_case_346: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st347 - } - goto st336 - st347: - if p++; p == pe { - goto _test_eof347 - } - st_case_347: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st348 - } - goto st336 - st348: - if p++; p == pe { - goto _test_eof348 - } - st_case_348: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st349 - } - goto st336 - st349: - if p++; p == pe { - goto _test_eof349 - } - st_case_349: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st350 - } - goto st336 - st350: - if p++; p == pe { - goto _test_eof350 - } - st_case_350: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st351 - } - goto st336 - st351: - if p++; p == pe { - goto _test_eof351 - } - st_case_351: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st352 - } - goto st336 - st352: - if p++; p == pe { - goto _test_eof352 - } - st_case_352: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st353 - } - goto st336 - st353: - if p++; p == pe { - goto _test_eof353 - } - st_case_353: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st354 - } - goto st336 - st354: - if p++; p == pe { - goto _test_eof354 - } - st_case_354: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st355 - } - goto st336 - st355: - if p++; p == pe { - goto _test_eof355 - } - st_case_355: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st356 - } - goto st336 - st356: - if p++; p == pe { - goto _test_eof356 - } - st_case_356: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st357 - } - goto st336 - st357: - if p++; p == pe { - goto _test_eof357 - } - st_case_357: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st358 - } - goto st336 - st358: - if p++; p == pe { - goto _test_eof358 - } - st_case_358: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st359 - } - goto st336 - st359: - if p++; p == pe { - goto _test_eof359 - } - st_case_359: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st360 - } - goto st336 - st360: - if p++; p == pe { - goto _test_eof360 - } - st_case_360: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st361 - } - goto st336 - st361: - if p++; p == pe { - goto _test_eof361 - } - st_case_361: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st362 - } - goto st336 - st362: - if p++; p == pe { - goto _test_eof362 - } - st_case_362: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st363 - } - goto st336 - st363: - if p++; p == pe { - goto _test_eof363 - } - st_case_363: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st364 - } - goto st336 - st364: - if p++; p == pe { - goto _test_eof364 - } - st_case_364: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st365 - } - goto st336 - st365: - if p++; p == pe { - goto _test_eof365 - } - st_case_365: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st366 - } - goto st336 - st366: - if p++; p == pe { - goto _test_eof366 - } - st_case_366: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st367 - } - goto st336 - st367: - if p++; p == pe { - goto _test_eof367 - } - st_case_367: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - if 33 <= data[p] && data[p] <= 126 { - goto st368 - } - goto st336 - st368: - if p++; p == pe { - goto _test_eof368 - } - st_case_368: - switch data[p] { - case 58: - goto tr344 - case 91: - goto tr345 - } - goto st336 - tr344: -//line parser/rfc3164.rl:7 - - m.setTag(data[tok:p]) - - goto st369 - st369: - if p++; p == pe { - goto _test_eof369 - } - st_case_369: -//line rfc3164_gen.go:1726 - if data[p] == 32 { - goto st370 - } - goto st336 - st370: - if p++; p == pe { - goto _test_eof370 - } - st_case_370: - goto tr51 - tr345: -//line parser/rfc3164.rl:7 - - m.setTag(data[tok:p]) - - goto st371 - st371: - if p++; p == pe { - goto _test_eof371 - } - st_case_371: -//line rfc3164_gen.go:1748 - if 32 <= data[p] && data[p] <= 126 { - goto tr377 - } - goto st336 - tr377: -//line parser/common.rl:4 - - tok = p - - goto st372 - st372: - if p++; p == pe { - goto _test_eof372 - } - st_case_372: -//line rfc3164_gen.go:1764 - if data[p] == 93 { - goto tr379 - } - if 32 <= data[p] && data[p] <= 126 { - goto st372 - } - goto st336 - tr379: -//line parser/rfc3164.rl:11 - - m.setContent(data[tok:p]) - - goto st373 - tr382: -//line parser/rfc3164.rl:11 - - m.setContent(data[tok:p]) - -//line parser/common.rl:4 - - tok = p - - goto st373 - st373: - if p++; p == pe { - goto _test_eof373 - } - st_case_373: -//line rfc3164_gen.go:1793 - switch data[p] { - case 58: - goto st374 - case 93: - goto tr379 - } - if 32 <= data[p] && data[p] <= 126 { - goto st372 - } - goto st336 - st374: - if p++; p == pe { - goto _test_eof374 - } - st_case_374: - switch data[p] { - case 32: - goto st375 - case 93: - goto tr379 - } - if 33 <= data[p] && data[p] <= 126 { - goto st372 - } - goto st336 - st375: - if p++; p == pe { - goto _test_eof375 - } - st_case_375: - if data[p] == 93 { - goto tr382 - } - if 32 <= data[p] && data[p] <= 126 { - goto tr377 - } - goto tr51 - st33: - if p++; p == pe { - goto _test_eof33 - } - st_case_33: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st34 - } - goto tr47 - st34: - if p++; p == pe { - goto _test_eof34 - } - st_case_34: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st35 - } - goto tr47 - st35: - if p++; p == pe { - goto _test_eof35 - } - st_case_35: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st36 - } - goto tr47 - st36: - if p++; p == pe { - goto _test_eof36 - } - st_case_36: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st37 - } - goto tr47 - st37: - if p++; p == pe { - goto _test_eof37 - } - st_case_37: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st38 - } - goto tr47 - st38: - if p++; p == pe { - goto _test_eof38 - } - st_case_38: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st39 - } - goto tr47 - st39: - if p++; p == pe { - goto _test_eof39 - } - st_case_39: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st40 - } - goto tr47 - st40: - if p++; p == pe { - goto _test_eof40 - } - st_case_40: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st41 - } - goto tr47 - st41: - if p++; p == pe { - goto _test_eof41 - } - st_case_41: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st42 - } - goto tr47 - st42: - if p++; p == pe { - goto _test_eof42 - } - st_case_42: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st43 - } - goto tr47 - st43: - if p++; p == pe { - goto _test_eof43 - } - st_case_43: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st44 - } - goto tr47 - st44: - if p++; p == pe { - goto _test_eof44 - } - st_case_44: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st45 - } - goto tr47 - st45: - if p++; p == pe { - goto _test_eof45 - } - st_case_45: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st46 - } - goto tr47 - st46: - if p++; p == pe { - goto _test_eof46 - } - st_case_46: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st47 - } - goto tr47 - st47: - if p++; p == pe { - goto _test_eof47 - } - st_case_47: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st48 - } - goto tr47 - st48: - if p++; p == pe { - goto _test_eof48 - } - st_case_48: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st49 - } - goto tr47 - st49: - if p++; p == pe { - goto _test_eof49 - } - st_case_49: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st50 - } - goto tr47 - st50: - if p++; p == pe { - goto _test_eof50 - } - st_case_50: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st51 - } - goto tr47 - st51: - if p++; p == pe { - goto _test_eof51 - } - st_case_51: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st52 - } - goto tr47 - st52: - if p++; p == pe { - goto _test_eof52 - } - st_case_52: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st53 - } - goto tr47 - st53: - if p++; p == pe { - goto _test_eof53 - } - st_case_53: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st54 - } - goto tr47 - st54: - if p++; p == pe { - goto _test_eof54 - } - st_case_54: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st55 - } - goto tr47 - st55: - if p++; p == pe { - goto _test_eof55 - } - st_case_55: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st56 - } - goto tr47 - st56: - if p++; p == pe { - goto _test_eof56 - } - st_case_56: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st57 - } - goto tr47 - st57: - if p++; p == pe { - goto _test_eof57 - } - st_case_57: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st58 - } - goto tr47 - st58: - if p++; p == pe { - goto _test_eof58 - } - st_case_58: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st59 - } - goto tr47 - st59: - if p++; p == pe { - goto _test_eof59 - } - st_case_59: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st60 - } - goto tr47 - st60: - if p++; p == pe { - goto _test_eof60 - } - st_case_60: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st61 - } - goto tr47 - st61: - if p++; p == pe { - goto _test_eof61 - } - st_case_61: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st62 - } - goto tr47 - st62: - if p++; p == pe { - goto _test_eof62 - } - st_case_62: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st63 - } - goto tr47 - st63: - if p++; p == pe { - goto _test_eof63 - } - st_case_63: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st64 - } - goto tr47 - st64: - if p++; p == pe { - goto _test_eof64 - } - st_case_64: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st65 - } - goto tr47 - st65: - if p++; p == pe { - goto _test_eof65 - } - st_case_65: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st66 - } - goto tr47 - st66: - if p++; p == pe { - goto _test_eof66 - } - st_case_66: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st67 - } - goto tr47 - st67: - if p++; p == pe { - goto _test_eof67 - } - st_case_67: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st68 - } - goto tr47 - st68: - if p++; p == pe { - goto _test_eof68 - } - st_case_68: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st69 - } - goto tr47 - st69: - if p++; p == pe { - goto _test_eof69 - } - st_case_69: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st70 - } - goto tr47 - st70: - if p++; p == pe { - goto _test_eof70 - } - st_case_70: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st71 - } - goto tr47 - st71: - if p++; p == pe { - goto _test_eof71 - } - st_case_71: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st72 - } - goto tr47 - st72: - if p++; p == pe { - goto _test_eof72 - } - st_case_72: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st73 - } - goto tr47 - st73: - if p++; p == pe { - goto _test_eof73 - } - st_case_73: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st74 - } - goto tr47 - st74: - if p++; p == pe { - goto _test_eof74 - } - st_case_74: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st75 - } - goto tr47 - st75: - if p++; p == pe { - goto _test_eof75 - } - st_case_75: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st76 - } - goto tr47 - st76: - if p++; p == pe { - goto _test_eof76 - } - st_case_76: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st77 - } - goto tr47 - st77: - if p++; p == pe { - goto _test_eof77 - } - st_case_77: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st78 - } - goto tr47 - st78: - if p++; p == pe { - goto _test_eof78 - } - st_case_78: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st79 - } - goto tr47 - st79: - if p++; p == pe { - goto _test_eof79 - } - st_case_79: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st80 - } - goto tr47 - st80: - if p++; p == pe { - goto _test_eof80 - } - st_case_80: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st81 - } - goto tr47 - st81: - if p++; p == pe { - goto _test_eof81 - } - st_case_81: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st82 - } - goto tr47 - st82: - if p++; p == pe { - goto _test_eof82 - } - st_case_82: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st83 - } - goto tr47 - st83: - if p++; p == pe { - goto _test_eof83 - } - st_case_83: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st84 - } - goto tr47 - st84: - if p++; p == pe { - goto _test_eof84 - } - st_case_84: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st85 - } - goto tr47 - st85: - if p++; p == pe { - goto _test_eof85 - } - st_case_85: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st86 - } - goto tr47 - st86: - if p++; p == pe { - goto _test_eof86 - } - st_case_86: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st87 - } - goto tr47 - st87: - if p++; p == pe { - goto _test_eof87 - } - st_case_87: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st88 - } - goto tr47 - st88: - if p++; p == pe { - goto _test_eof88 - } - st_case_88: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st89 - } - goto tr47 - st89: - if p++; p == pe { - goto _test_eof89 - } - st_case_89: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st90 - } - goto tr47 - st90: - if p++; p == pe { - goto _test_eof90 - } - st_case_90: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st91 - } - goto tr47 - st91: - if p++; p == pe { - goto _test_eof91 - } - st_case_91: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st92 - } - goto tr47 - st92: - if p++; p == pe { - goto _test_eof92 - } - st_case_92: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st93 - } - goto tr47 - st93: - if p++; p == pe { - goto _test_eof93 - } - st_case_93: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st94 - } - goto tr47 - st94: - if p++; p == pe { - goto _test_eof94 - } - st_case_94: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st95 - } - goto tr47 - st95: - if p++; p == pe { - goto _test_eof95 - } - st_case_95: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st96 - } - goto tr47 - st96: - if p++; p == pe { - goto _test_eof96 - } - st_case_96: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st97 - } - goto tr47 - st97: - if p++; p == pe { - goto _test_eof97 - } - st_case_97: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st98 - } - goto tr47 - st98: - if p++; p == pe { - goto _test_eof98 - } - st_case_98: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st99 - } - goto tr47 - st99: - if p++; p == pe { - goto _test_eof99 - } - st_case_99: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st100 - } - goto tr47 - st100: - if p++; p == pe { - goto _test_eof100 - } - st_case_100: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st101 - } - goto tr47 - st101: - if p++; p == pe { - goto _test_eof101 - } - st_case_101: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st102 - } - goto tr47 - st102: - if p++; p == pe { - goto _test_eof102 - } - st_case_102: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st103 - } - goto tr47 - st103: - if p++; p == pe { - goto _test_eof103 - } - st_case_103: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st104 - } - goto tr47 - st104: - if p++; p == pe { - goto _test_eof104 - } - st_case_104: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st105 - } - goto tr47 - st105: - if p++; p == pe { - goto _test_eof105 - } - st_case_105: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st106 - } - goto tr47 - st106: - if p++; p == pe { - goto _test_eof106 - } - st_case_106: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st107 - } - goto tr47 - st107: - if p++; p == pe { - goto _test_eof107 - } - st_case_107: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st108 - } - goto tr47 - st108: - if p++; p == pe { - goto _test_eof108 - } - st_case_108: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st109 - } - goto tr47 - st109: - if p++; p == pe { - goto _test_eof109 - } - st_case_109: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st110 - } - goto tr47 - st110: - if p++; p == pe { - goto _test_eof110 - } - st_case_110: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st111 - } - goto tr47 - st111: - if p++; p == pe { - goto _test_eof111 - } - st_case_111: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st112 - } - goto tr47 - st112: - if p++; p == pe { - goto _test_eof112 - } - st_case_112: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st113 - } - goto tr47 - st113: - if p++; p == pe { - goto _test_eof113 - } - st_case_113: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st114 - } - goto tr47 - st114: - if p++; p == pe { - goto _test_eof114 - } - st_case_114: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st115 - } - goto tr47 - st115: - if p++; p == pe { - goto _test_eof115 - } - st_case_115: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st116 - } - goto tr47 - st116: - if p++; p == pe { - goto _test_eof116 - } - st_case_116: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st117 - } - goto tr47 - st117: - if p++; p == pe { - goto _test_eof117 - } - st_case_117: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st118 - } - goto tr47 - st118: - if p++; p == pe { - goto _test_eof118 - } - st_case_118: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st119 - } - goto tr47 - st119: - if p++; p == pe { - goto _test_eof119 - } - st_case_119: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st120 - } - goto tr47 - st120: - if p++; p == pe { - goto _test_eof120 - } - st_case_120: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st121 - } - goto tr47 - st121: - if p++; p == pe { - goto _test_eof121 - } - st_case_121: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st122 - } - goto tr47 - st122: - if p++; p == pe { - goto _test_eof122 - } - st_case_122: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st123 - } - goto tr47 - st123: - if p++; p == pe { - goto _test_eof123 - } - st_case_123: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st124 - } - goto tr47 - st124: - if p++; p == pe { - goto _test_eof124 - } - st_case_124: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st125 - } - goto tr47 - st125: - if p++; p == pe { - goto _test_eof125 - } - st_case_125: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st126 - } - goto tr47 - st126: - if p++; p == pe { - goto _test_eof126 - } - st_case_126: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st127 - } - goto tr47 - st127: - if p++; p == pe { - goto _test_eof127 - } - st_case_127: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st128 - } - goto tr47 - st128: - if p++; p == pe { - goto _test_eof128 - } - st_case_128: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st129 - } - goto tr47 - st129: - if p++; p == pe { - goto _test_eof129 - } - st_case_129: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st130 - } - goto tr47 - st130: - if p++; p == pe { - goto _test_eof130 - } - st_case_130: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st131 - } - goto tr47 - st131: - if p++; p == pe { - goto _test_eof131 - } - st_case_131: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st132 - } - goto tr47 - st132: - if p++; p == pe { - goto _test_eof132 - } - st_case_132: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st133 - } - goto tr47 - st133: - if p++; p == pe { - goto _test_eof133 - } - st_case_133: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st134 - } - goto tr47 - st134: - if p++; p == pe { - goto _test_eof134 - } - st_case_134: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st135 - } - goto tr47 - st135: - if p++; p == pe { - goto _test_eof135 - } - st_case_135: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st136 - } - goto tr47 - st136: - if p++; p == pe { - goto _test_eof136 - } - st_case_136: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st137 - } - goto tr47 - st137: - if p++; p == pe { - goto _test_eof137 - } - st_case_137: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st138 - } - goto tr47 - st138: - if p++; p == pe { - goto _test_eof138 - } - st_case_138: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st139 - } - goto tr47 - st139: - if p++; p == pe { - goto _test_eof139 - } - st_case_139: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st140 - } - goto tr47 - st140: - if p++; p == pe { - goto _test_eof140 - } - st_case_140: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st141 - } - goto tr47 - st141: - if p++; p == pe { - goto _test_eof141 - } - st_case_141: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st142 - } - goto tr47 - st142: - if p++; p == pe { - goto _test_eof142 - } - st_case_142: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st143 - } - goto tr47 - st143: - if p++; p == pe { - goto _test_eof143 - } - st_case_143: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st144 - } - goto tr47 - st144: - if p++; p == pe { - goto _test_eof144 - } - st_case_144: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st145 - } - goto tr47 - st145: - if p++; p == pe { - goto _test_eof145 - } - st_case_145: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st146 - } - goto tr47 - st146: - if p++; p == pe { - goto _test_eof146 - } - st_case_146: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st147 - } - goto tr47 - st147: - if p++; p == pe { - goto _test_eof147 - } - st_case_147: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st148 - } - goto tr47 - st148: - if p++; p == pe { - goto _test_eof148 - } - st_case_148: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st149 - } - goto tr47 - st149: - if p++; p == pe { - goto _test_eof149 - } - st_case_149: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st150 - } - goto tr47 - st150: - if p++; p == pe { - goto _test_eof150 - } - st_case_150: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st151 - } - goto tr47 - st151: - if p++; p == pe { - goto _test_eof151 - } - st_case_151: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st152 - } - goto tr47 - st152: - if p++; p == pe { - goto _test_eof152 - } - st_case_152: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st153 - } - goto tr47 - st153: - if p++; p == pe { - goto _test_eof153 - } - st_case_153: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st154 - } - goto tr47 - st154: - if p++; p == pe { - goto _test_eof154 - } - st_case_154: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st155 - } - goto tr47 - st155: - if p++; p == pe { - goto _test_eof155 - } - st_case_155: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st156 - } - goto tr47 - st156: - if p++; p == pe { - goto _test_eof156 - } - st_case_156: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st157 - } - goto tr47 - st157: - if p++; p == pe { - goto _test_eof157 - } - st_case_157: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st158 - } - goto tr47 - st158: - if p++; p == pe { - goto _test_eof158 - } - st_case_158: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st159 - } - goto tr47 - st159: - if p++; p == pe { - goto _test_eof159 - } - st_case_159: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st160 - } - goto tr47 - st160: - if p++; p == pe { - goto _test_eof160 - } - st_case_160: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st161 - } - goto tr47 - st161: - if p++; p == pe { - goto _test_eof161 - } - st_case_161: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st162 - } - goto tr47 - st162: - if p++; p == pe { - goto _test_eof162 - } - st_case_162: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st163 - } - goto tr47 - st163: - if p++; p == pe { - goto _test_eof163 - } - st_case_163: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st164 - } - goto tr47 - st164: - if p++; p == pe { - goto _test_eof164 - } - st_case_164: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st165 - } - goto tr47 - st165: - if p++; p == pe { - goto _test_eof165 - } - st_case_165: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st166 - } - goto tr47 - st166: - if p++; p == pe { - goto _test_eof166 - } - st_case_166: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st167 - } - goto tr47 - st167: - if p++; p == pe { - goto _test_eof167 - } - st_case_167: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st168 - } - goto tr47 - st168: - if p++; p == pe { - goto _test_eof168 - } - st_case_168: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st169 - } - goto tr47 - st169: - if p++; p == pe { - goto _test_eof169 - } - st_case_169: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st170 - } - goto tr47 - st170: - if p++; p == pe { - goto _test_eof170 - } - st_case_170: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st171 - } - goto tr47 - st171: - if p++; p == pe { - goto _test_eof171 - } - st_case_171: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st172 - } - goto tr47 - st172: - if p++; p == pe { - goto _test_eof172 - } - st_case_172: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st173 - } - goto tr47 - st173: - if p++; p == pe { - goto _test_eof173 - } - st_case_173: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st174 - } - goto tr47 - st174: - if p++; p == pe { - goto _test_eof174 - } - st_case_174: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st175 - } - goto tr47 - st175: - if p++; p == pe { - goto _test_eof175 - } - st_case_175: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st176 - } - goto tr47 - st176: - if p++; p == pe { - goto _test_eof176 - } - st_case_176: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st177 - } - goto tr47 - st177: - if p++; p == pe { - goto _test_eof177 - } - st_case_177: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st178 - } - goto tr47 - st178: - if p++; p == pe { - goto _test_eof178 - } - st_case_178: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st179 - } - goto tr47 - st179: - if p++; p == pe { - goto _test_eof179 - } - st_case_179: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st180 - } - goto tr47 - st180: - if p++; p == pe { - goto _test_eof180 - } - st_case_180: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st181 - } - goto tr47 - st181: - if p++; p == pe { - goto _test_eof181 - } - st_case_181: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st182 - } - goto tr47 - st182: - if p++; p == pe { - goto _test_eof182 - } - st_case_182: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st183 - } - goto tr47 - st183: - if p++; p == pe { - goto _test_eof183 - } - st_case_183: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st184 - } - goto tr47 - st184: - if p++; p == pe { - goto _test_eof184 - } - st_case_184: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st185 - } - goto tr47 - st185: - if p++; p == pe { - goto _test_eof185 - } - st_case_185: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st186 - } - goto tr47 - st186: - if p++; p == pe { - goto _test_eof186 - } - st_case_186: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st187 - } - goto tr47 - st187: - if p++; p == pe { - goto _test_eof187 - } - st_case_187: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st188 - } - goto tr47 - st188: - if p++; p == pe { - goto _test_eof188 - } - st_case_188: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st189 - } - goto tr47 - st189: - if p++; p == pe { - goto _test_eof189 - } - st_case_189: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st190 - } - goto tr47 - st190: - if p++; p == pe { - goto _test_eof190 - } - st_case_190: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st191 - } - goto tr47 - st191: - if p++; p == pe { - goto _test_eof191 - } - st_case_191: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st192 - } - goto tr47 - st192: - if p++; p == pe { - goto _test_eof192 - } - st_case_192: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st193 - } - goto tr47 - st193: - if p++; p == pe { - goto _test_eof193 - } - st_case_193: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st194 - } - goto tr47 - st194: - if p++; p == pe { - goto _test_eof194 - } - st_case_194: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st195 - } - goto tr47 - st195: - if p++; p == pe { - goto _test_eof195 - } - st_case_195: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st196 - } - goto tr47 - st196: - if p++; p == pe { - goto _test_eof196 - } - st_case_196: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st197 - } - goto tr47 - st197: - if p++; p == pe { - goto _test_eof197 - } - st_case_197: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st198 - } - goto tr47 - st198: - if p++; p == pe { - goto _test_eof198 - } - st_case_198: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st199 - } - goto tr47 - st199: - if p++; p == pe { - goto _test_eof199 - } - st_case_199: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st200 - } - goto tr47 - st200: - if p++; p == pe { - goto _test_eof200 - } - st_case_200: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st201 - } - goto tr47 - st201: - if p++; p == pe { - goto _test_eof201 - } - st_case_201: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st202 - } - goto tr47 - st202: - if p++; p == pe { - goto _test_eof202 - } - st_case_202: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st203 - } - goto tr47 - st203: - if p++; p == pe { - goto _test_eof203 - } - st_case_203: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st204 - } - goto tr47 - st204: - if p++; p == pe { - goto _test_eof204 - } - st_case_204: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st205 - } - goto tr47 - st205: - if p++; p == pe { - goto _test_eof205 - } - st_case_205: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st206 - } - goto tr47 - st206: - if p++; p == pe { - goto _test_eof206 - } - st_case_206: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st207 - } - goto tr47 - st207: - if p++; p == pe { - goto _test_eof207 - } - st_case_207: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st208 - } - goto tr47 - st208: - if p++; p == pe { - goto _test_eof208 - } - st_case_208: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st209 - } - goto tr47 - st209: - if p++; p == pe { - goto _test_eof209 - } - st_case_209: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st210 - } - goto tr47 - st210: - if p++; p == pe { - goto _test_eof210 - } - st_case_210: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st211 - } - goto tr47 - st211: - if p++; p == pe { - goto _test_eof211 - } - st_case_211: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st212 - } - goto tr47 - st212: - if p++; p == pe { - goto _test_eof212 - } - st_case_212: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st213 - } - goto tr47 - st213: - if p++; p == pe { - goto _test_eof213 - } - st_case_213: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st214 - } - goto tr47 - st214: - if p++; p == pe { - goto _test_eof214 - } - st_case_214: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st215 - } - goto tr47 - st215: - if p++; p == pe { - goto _test_eof215 - } - st_case_215: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st216 - } - goto tr47 - st216: - if p++; p == pe { - goto _test_eof216 - } - st_case_216: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st217 - } - goto tr47 - st217: - if p++; p == pe { - goto _test_eof217 - } - st_case_217: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st218 - } - goto tr47 - st218: - if p++; p == pe { - goto _test_eof218 - } - st_case_218: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st219 - } - goto tr47 - st219: - if p++; p == pe { - goto _test_eof219 - } - st_case_219: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st220 - } - goto tr47 - st220: - if p++; p == pe { - goto _test_eof220 - } - st_case_220: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st221 - } - goto tr47 - st221: - if p++; p == pe { - goto _test_eof221 - } - st_case_221: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st222 - } - goto tr47 - st222: - if p++; p == pe { - goto _test_eof222 - } - st_case_222: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st223 - } - goto tr47 - st223: - if p++; p == pe { - goto _test_eof223 - } - st_case_223: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st224 - } - goto tr47 - st224: - if p++; p == pe { - goto _test_eof224 - } - st_case_224: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st225 - } - goto tr47 - st225: - if p++; p == pe { - goto _test_eof225 - } - st_case_225: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st226 - } - goto tr47 - st226: - if p++; p == pe { - goto _test_eof226 - } - st_case_226: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st227 - } - goto tr47 - st227: - if p++; p == pe { - goto _test_eof227 - } - st_case_227: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st228 - } - goto tr47 - st228: - if p++; p == pe { - goto _test_eof228 - } - st_case_228: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st229 - } - goto tr47 - st229: - if p++; p == pe { - goto _test_eof229 - } - st_case_229: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st230 - } - goto tr47 - st230: - if p++; p == pe { - goto _test_eof230 - } - st_case_230: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st231 - } - goto tr47 - st231: - if p++; p == pe { - goto _test_eof231 - } - st_case_231: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st232 - } - goto tr47 - st232: - if p++; p == pe { - goto _test_eof232 - } - st_case_232: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st233 - } - goto tr47 - st233: - if p++; p == pe { - goto _test_eof233 - } - st_case_233: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st234 - } - goto tr47 - st234: - if p++; p == pe { - goto _test_eof234 - } - st_case_234: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st235 - } - goto tr47 - st235: - if p++; p == pe { - goto _test_eof235 - } - st_case_235: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st236 - } - goto tr47 - st236: - if p++; p == pe { - goto _test_eof236 - } - st_case_236: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st237 - } - goto tr47 - st237: - if p++; p == pe { - goto _test_eof237 - } - st_case_237: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st238 - } - goto tr47 - st238: - if p++; p == pe { - goto _test_eof238 - } - st_case_238: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st239 - } - goto tr47 - st239: - if p++; p == pe { - goto _test_eof239 - } - st_case_239: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st240 - } - goto tr47 - st240: - if p++; p == pe { - goto _test_eof240 - } - st_case_240: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st241 - } - goto tr47 - st241: - if p++; p == pe { - goto _test_eof241 - } - st_case_241: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st242 - } - goto tr47 - st242: - if p++; p == pe { - goto _test_eof242 - } - st_case_242: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st243 - } - goto tr47 - st243: - if p++; p == pe { - goto _test_eof243 - } - st_case_243: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st244 - } - goto tr47 - st244: - if p++; p == pe { - goto _test_eof244 - } - st_case_244: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st245 - } - goto tr47 - st245: - if p++; p == pe { - goto _test_eof245 - } - st_case_245: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st246 - } - goto tr47 - st246: - if p++; p == pe { - goto _test_eof246 - } - st_case_246: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st247 - } - goto tr47 - st247: - if p++; p == pe { - goto _test_eof247 - } - st_case_247: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st248 - } - goto tr47 - st248: - if p++; p == pe { - goto _test_eof248 - } - st_case_248: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st249 - } - goto tr47 - st249: - if p++; p == pe { - goto _test_eof249 - } - st_case_249: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st250 - } - goto tr47 - st250: - if p++; p == pe { - goto _test_eof250 - } - st_case_250: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st251 - } - goto tr47 - st251: - if p++; p == pe { - goto _test_eof251 - } - st_case_251: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st252 - } - goto tr47 - st252: - if p++; p == pe { - goto _test_eof252 - } - st_case_252: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st253 - } - goto tr47 - st253: - if p++; p == pe { - goto _test_eof253 - } - st_case_253: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st254 - } - goto tr47 - st254: - if p++; p == pe { - goto _test_eof254 - } - st_case_254: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st255 - } - goto tr47 - st255: - if p++; p == pe { - goto _test_eof255 - } - st_case_255: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st256 - } - goto tr47 - st256: - if p++; p == pe { - goto _test_eof256 - } - st_case_256: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st257 - } - goto tr47 - st257: - if p++; p == pe { - goto _test_eof257 - } - st_case_257: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st258 - } - goto tr47 - st258: - if p++; p == pe { - goto _test_eof258 - } - st_case_258: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st259 - } - goto tr47 - st259: - if p++; p == pe { - goto _test_eof259 - } - st_case_259: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st260 - } - goto tr47 - st260: - if p++; p == pe { - goto _test_eof260 - } - st_case_260: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st261 - } - goto tr47 - st261: - if p++; p == pe { - goto _test_eof261 - } - st_case_261: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st262 - } - goto tr47 - st262: - if p++; p == pe { - goto _test_eof262 - } - st_case_262: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st263 - } - goto tr47 - st263: - if p++; p == pe { - goto _test_eof263 - } - st_case_263: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st264 - } - goto tr47 - st264: - if p++; p == pe { - goto _test_eof264 - } - st_case_264: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st265 - } - goto tr47 - st265: - if p++; p == pe { - goto _test_eof265 - } - st_case_265: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st266 - } - goto tr47 - st266: - if p++; p == pe { - goto _test_eof266 - } - st_case_266: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st267 - } - goto tr47 - st267: - if p++; p == pe { - goto _test_eof267 - } - st_case_267: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st268 - } - goto tr47 - st268: - if p++; p == pe { - goto _test_eof268 - } - st_case_268: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st269 - } - goto tr47 - st269: - if p++; p == pe { - goto _test_eof269 - } - st_case_269: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st270 - } - goto tr47 - st270: - if p++; p == pe { - goto _test_eof270 - } - st_case_270: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st271 - } - goto tr47 - st271: - if p++; p == pe { - goto _test_eof271 - } - st_case_271: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st272 - } - goto tr47 - st272: - if p++; p == pe { - goto _test_eof272 - } - st_case_272: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st273 - } - goto tr47 - st273: - if p++; p == pe { - goto _test_eof273 - } - st_case_273: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st274 - } - goto tr47 - st274: - if p++; p == pe { - goto _test_eof274 - } - st_case_274: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st275 - } - goto tr47 - st275: - if p++; p == pe { - goto _test_eof275 - } - st_case_275: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st276 - } - goto tr47 - st276: - if p++; p == pe { - goto _test_eof276 - } - st_case_276: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st277 - } - goto tr47 - st277: - if p++; p == pe { - goto _test_eof277 - } - st_case_277: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st278 - } - goto tr47 - st278: - if p++; p == pe { - goto _test_eof278 - } - st_case_278: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st279 - } - goto tr47 - st279: - if p++; p == pe { - goto _test_eof279 - } - st_case_279: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st280 - } - goto tr47 - st280: - if p++; p == pe { - goto _test_eof280 - } - st_case_280: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st281 - } - goto tr47 - st281: - if p++; p == pe { - goto _test_eof281 - } - st_case_281: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st282 - } - goto tr47 - st282: - if p++; p == pe { - goto _test_eof282 - } - st_case_282: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st283 - } - goto tr47 - st283: - if p++; p == pe { - goto _test_eof283 - } - st_case_283: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st284 - } - goto tr47 - st284: - if p++; p == pe { - goto _test_eof284 - } - st_case_284: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st285 - } - goto tr47 - st285: - if p++; p == pe { - goto _test_eof285 - } - st_case_285: - if data[p] == 32 { - goto tr49 - } - if 33 <= data[p] && data[p] <= 126 { - goto st286 - } - goto tr47 - st286: - if p++; p == pe { - goto _test_eof286 - } - st_case_286: - if data[p] == 32 { - goto tr49 - } - goto tr47 - st287: - if p++; p == pe { - goto _test_eof287 - } - st_case_287: - if 48 <= data[p] && data[p] <= 51 { - goto st26 - } - goto tr6 - st288: - if p++; p == pe { - goto _test_eof288 - } - st_case_288: - if 48 <= data[p] && data[p] <= 57 { - goto st289 - } - goto tr6 - st289: - if p++; p == pe { - goto _test_eof289 - } - st_case_289: - switch data[p] { - case 43: - goto st24 - case 45: - goto st24 - case 90: - goto st29 - } - if 48 <= data[p] && data[p] <= 57 { - goto st290 - } - goto tr6 - st290: - if p++; p == pe { - goto _test_eof290 - } - st_case_290: - switch data[p] { - case 43: - goto st24 - case 45: - goto st24 - case 90: - goto st29 - } - if 48 <= data[p] && data[p] <= 57 { - goto st291 - } - goto tr6 - st291: - if p++; p == pe { - goto _test_eof291 - } - st_case_291: - switch data[p] { - case 43: - goto st24 - case 45: - goto st24 - case 90: - goto st29 - } - if 48 <= data[p] && data[p] <= 57 { - goto st292 - } - goto tr6 - st292: - if p++; p == pe { - goto _test_eof292 - } - st_case_292: - switch data[p] { - case 43: - goto st24 - case 45: - goto st24 - case 90: - goto st29 - } - if 48 <= data[p] && data[p] <= 57 { - goto st293 - } - goto tr6 - st293: - if p++; p == pe { - goto _test_eof293 - } - st_case_293: - switch data[p] { - case 43: - goto st24 - case 45: - goto st24 - case 90: - goto st29 - } - if 48 <= data[p] && data[p] <= 57 { - goto st294 - } - goto tr6 - st294: - if p++; p == pe { - goto _test_eof294 - } - st_case_294: - switch data[p] { - case 43: - goto st24 - case 45: - goto st24 - case 90: - goto st29 - } - goto tr6 - st295: - if p++; p == pe { - goto _test_eof295 - } - st_case_295: - if 48 <= data[p] && data[p] <= 51 { - goto st17 - } - goto tr6 - st296: - if p++; p == pe { - goto _test_eof296 - } - st_case_296: - if 48 <= data[p] && data[p] <= 57 { - goto st14 - } - goto tr6 - st297: - if p++; p == pe { - goto _test_eof297 - } - st_case_297: - if 48 <= data[p] && data[p] <= 49 { - goto st14 - } - goto tr6 - st298: - if p++; p == pe { - goto _test_eof298 - } - st_case_298: - if 48 <= data[p] && data[p] <= 50 { - goto st11 - } - goto tr6 - tr8: -//line parser/common.rl:4 - - tok = p - - goto st299 - st299: - if p++; p == pe { - goto _test_eof299 - } - st_case_299: -//line rfc3164_gen.go:5040 - switch data[p] { - case 112: - goto st300 - case 117: - goto st317 - } - goto tr6 - st300: - if p++; p == pe { - goto _test_eof300 - } - st_case_300: - if data[p] == 114 { - goto st301 - } - goto tr6 - st301: - if p++; p == pe { - goto _test_eof301 - } - st_case_301: - if data[p] == 32 { - goto st302 - } - goto tr6 - st302: - if p++; p == pe { - goto _test_eof302 - } - st_case_302: - switch data[p] { - case 32: - goto st303 - case 48: - goto st303 - case 51: - goto st316 - } - if 49 <= data[p] && data[p] <= 50 { - goto st315 - } - goto tr6 - st303: - if p++; p == pe { - goto _test_eof303 - } - st_case_303: - if 49 <= data[p] && data[p] <= 57 { - goto st304 - } - goto tr6 - st304: - if p++; p == pe { - goto _test_eof304 - } - st_case_304: - if data[p] == 32 { - goto st305 - } - goto tr6 - st305: - if p++; p == pe { - goto _test_eof305 - } - st_case_305: - if data[p] == 50 { - goto st314 - } - if 48 <= data[p] && data[p] <= 49 { - goto st306 - } - goto tr6 - st306: - if p++; p == pe { - goto _test_eof306 - } - st_case_306: - if 48 <= data[p] && data[p] <= 57 { - goto st307 - } - goto tr6 - st307: - if p++; p == pe { - goto _test_eof307 - } - st_case_307: - if data[p] == 58 { - goto st308 - } - goto tr6 - st308: - if p++; p == pe { - goto _test_eof308 - } - st_case_308: - if 48 <= data[p] && data[p] <= 53 { - goto st309 - } - goto tr6 - st309: - if p++; p == pe { - goto _test_eof309 - } - st_case_309: - if 48 <= data[p] && data[p] <= 57 { - goto st310 - } - goto tr6 - st310: - if p++; p == pe { - goto _test_eof310 - } - st_case_310: - if data[p] == 58 { - goto st311 - } - goto tr6 - st311: - if p++; p == pe { - goto _test_eof311 - } - st_case_311: - if 48 <= data[p] && data[p] <= 53 { - goto st312 - } - goto tr6 - st312: - if p++; p == pe { - goto _test_eof312 - } - st_case_312: - if 48 <= data[p] && data[p] <= 57 { - goto st313 - } - goto tr6 - st313: - if p++; p == pe { - goto _test_eof313 - } - st_case_313: - if data[p] == 32 { - goto tr330 - } - goto tr6 - st314: - if p++; p == pe { - goto _test_eof314 - } - st_case_314: - if 48 <= data[p] && data[p] <= 51 { - goto st307 - } - goto tr6 - st315: - if p++; p == pe { - goto _test_eof315 - } - st_case_315: - if 48 <= data[p] && data[p] <= 57 { - goto st304 - } - goto tr6 - st316: - if p++; p == pe { - goto _test_eof316 - } - st_case_316: - if 48 <= data[p] && data[p] <= 49 { - goto st304 - } - goto tr6 - st317: - if p++; p == pe { - goto _test_eof317 - } - st_case_317: - if data[p] == 103 { - goto st301 - } - goto tr6 - tr9: -//line parser/common.rl:4 - - tok = p - - goto st318 - st318: - if p++; p == pe { - goto _test_eof318 - } - st_case_318: -//line rfc3164_gen.go:5232 - if data[p] == 101 { - goto st319 - } - goto tr6 - st319: - if p++; p == pe { - goto _test_eof319 - } - st_case_319: - if data[p] == 99 { - goto st301 - } - goto tr6 - tr10: -//line parser/common.rl:4 - - tok = p - - goto st320 - st320: - if p++; p == pe { - goto _test_eof320 - } - st_case_320: -//line rfc3164_gen.go:5257 - if data[p] == 101 { - goto st321 - } - goto tr6 - st321: - if p++; p == pe { - goto _test_eof321 - } - st_case_321: - if data[p] == 98 { - goto st301 - } - goto tr6 - tr11: -//line parser/common.rl:4 - - tok = p - - goto st322 - st322: - if p++; p == pe { - goto _test_eof322 - } - st_case_322: -//line rfc3164_gen.go:5282 - switch data[p] { - case 97: - goto st323 - case 117: - goto st324 - } - goto tr6 - st323: - if p++; p == pe { - goto _test_eof323 - } - st_case_323: - if data[p] == 110 { - goto st301 - } - goto tr6 - st324: - if p++; p == pe { - goto _test_eof324 - } - st_case_324: - switch data[p] { - case 108: - goto st301 - case 110: - goto st301 - } - goto tr6 - tr12: -//line parser/common.rl:4 - - tok = p - - goto st325 - st325: - if p++; p == pe { - goto _test_eof325 - } - st_case_325: -//line rfc3164_gen.go:5322 - if data[p] == 97 { - goto st326 - } - goto tr6 - st326: - if p++; p == pe { - goto _test_eof326 - } - st_case_326: - switch data[p] { - case 114: - goto st301 - case 121: - goto st301 - } - goto tr6 - tr13: -//line parser/common.rl:4 - - tok = p - - goto st327 - st327: - if p++; p == pe { - goto _test_eof327 - } - st_case_327: -//line rfc3164_gen.go:5350 - if data[p] == 111 { - goto st328 - } - goto tr6 - st328: - if p++; p == pe { - goto _test_eof328 - } - st_case_328: - if data[p] == 118 { - goto st301 - } - goto tr6 - tr14: -//line parser/common.rl:4 - - tok = p - - goto st329 - st329: - if p++; p == pe { - goto _test_eof329 - } - st_case_329: -//line rfc3164_gen.go:5375 - if data[p] == 99 { - goto st330 - } - goto tr6 - st330: - if p++; p == pe { - goto _test_eof330 - } - st_case_330: - if data[p] == 116 { - goto st301 - } - goto tr6 - tr15: -//line parser/common.rl:4 - - tok = p - - goto st331 - st331: - if p++; p == pe { - goto _test_eof331 - } - st_case_331: -//line rfc3164_gen.go:5400 - if data[p] == 101 { - goto st332 - } - goto tr6 - st332: - if p++; p == pe { - goto _test_eof332 - } - st_case_332: - if data[p] == 112 { - goto st301 - } - goto tr6 - tr3: -//line parser/common.rl:4 - - tok = p - - goto st333 - st333: - if p++; p == pe { - goto _test_eof333 - } - st_case_333: -//line rfc3164_gen.go:5425 - switch data[p] { - case 57: - goto st335 - case 62: - goto tr5 - } - if 48 <= data[p] && data[p] <= 56 { - goto st334 - } - goto tr0 - tr4: -//line parser/common.rl:4 - - tok = p - - goto st334 - st334: - if p++; p == pe { - goto _test_eof334 - } - st_case_334: -//line rfc3164_gen.go:5447 - if data[p] == 62 { - goto tr5 - } - if 48 <= data[p] && data[p] <= 57 { - goto st3 - } - goto tr0 - st335: - if p++; p == pe { - goto _test_eof335 - } - st_case_335: - if data[p] == 62 { - goto tr5 - } - if 48 <= data[p] && data[p] <= 49 { - goto st3 - } - goto tr0 - st_out: - _test_eof2: - cs = 2 - goto _test_eof - _test_eof3: - cs = 3 - goto _test_eof - _test_eof4: - cs = 4 - goto _test_eof - _test_eof5: - cs = 5 - goto _test_eof - _test_eof6: - cs = 6 - goto _test_eof - _test_eof7: - cs = 7 - goto _test_eof - _test_eof8: - cs = 8 - goto _test_eof - _test_eof9: - cs = 9 - goto _test_eof - _test_eof10: - cs = 10 - goto _test_eof - _test_eof11: - cs = 11 - goto _test_eof - _test_eof12: - cs = 12 - goto _test_eof - _test_eof13: - cs = 13 - goto _test_eof - _test_eof14: - cs = 14 - goto _test_eof - _test_eof15: - cs = 15 - goto _test_eof - _test_eof16: - cs = 16 - goto _test_eof - _test_eof17: - cs = 17 - goto _test_eof - _test_eof18: - cs = 18 - goto _test_eof - _test_eof19: - cs = 19 - goto _test_eof - _test_eof20: - cs = 20 - goto _test_eof - _test_eof21: - cs = 21 - goto _test_eof - _test_eof22: - cs = 22 - goto _test_eof - _test_eof23: - cs = 23 - goto _test_eof - _test_eof24: - cs = 24 - goto _test_eof - _test_eof25: - cs = 25 - goto _test_eof - _test_eof26: - cs = 26 - goto _test_eof - _test_eof27: - cs = 27 - goto _test_eof - _test_eof28: - cs = 28 - goto _test_eof - _test_eof29: - cs = 29 - goto _test_eof - _test_eof30: - cs = 30 - goto _test_eof - _test_eof31: - cs = 31 - goto _test_eof - _test_eof32: - cs = 32 - goto _test_eof - _test_eof336: - cs = 336 - goto _test_eof - _test_eof337: - cs = 337 - goto _test_eof - _test_eof338: - cs = 338 - goto _test_eof - _test_eof339: - cs = 339 - goto _test_eof - _test_eof340: - cs = 340 - goto _test_eof - _test_eof341: - cs = 341 - goto _test_eof - _test_eof342: - cs = 342 - goto _test_eof - _test_eof343: - cs = 343 - goto _test_eof - _test_eof344: - cs = 344 - goto _test_eof - _test_eof345: - cs = 345 - goto _test_eof - _test_eof346: - cs = 346 - goto _test_eof - _test_eof347: - cs = 347 - goto _test_eof - _test_eof348: - cs = 348 - goto _test_eof - _test_eof349: - cs = 349 - goto _test_eof - _test_eof350: - cs = 350 - goto _test_eof - _test_eof351: - cs = 351 - goto _test_eof - _test_eof352: - cs = 352 - goto _test_eof - _test_eof353: - cs = 353 - goto _test_eof - _test_eof354: - cs = 354 - goto _test_eof - _test_eof355: - cs = 355 - goto _test_eof - _test_eof356: - cs = 356 - goto _test_eof - _test_eof357: - cs = 357 - goto _test_eof - _test_eof358: - cs = 358 - goto _test_eof - _test_eof359: - cs = 359 - goto _test_eof - _test_eof360: - cs = 360 - goto _test_eof - _test_eof361: - cs = 361 - goto _test_eof - _test_eof362: - cs = 362 - goto _test_eof - _test_eof363: - cs = 363 - goto _test_eof - _test_eof364: - cs = 364 - goto _test_eof - _test_eof365: - cs = 365 - goto _test_eof - _test_eof366: - cs = 366 - goto _test_eof - _test_eof367: - cs = 367 - goto _test_eof - _test_eof368: - cs = 368 - goto _test_eof - _test_eof369: - cs = 369 - goto _test_eof - _test_eof370: - cs = 370 - goto _test_eof - _test_eof371: - cs = 371 - goto _test_eof - _test_eof372: - cs = 372 - goto _test_eof - _test_eof373: - cs = 373 - goto _test_eof - _test_eof374: - cs = 374 - goto _test_eof - _test_eof375: - cs = 375 - goto _test_eof - _test_eof33: - cs = 33 - goto _test_eof - _test_eof34: - cs = 34 - goto _test_eof - _test_eof35: - cs = 35 - goto _test_eof - _test_eof36: - cs = 36 - goto _test_eof - _test_eof37: - cs = 37 - goto _test_eof - _test_eof38: - cs = 38 - goto _test_eof - _test_eof39: - cs = 39 - goto _test_eof - _test_eof40: - cs = 40 - goto _test_eof - _test_eof41: - cs = 41 - goto _test_eof - _test_eof42: - cs = 42 - goto _test_eof - _test_eof43: - cs = 43 - goto _test_eof - _test_eof44: - cs = 44 - goto _test_eof - _test_eof45: - cs = 45 - goto _test_eof - _test_eof46: - cs = 46 - goto _test_eof - _test_eof47: - cs = 47 - goto _test_eof - _test_eof48: - cs = 48 - goto _test_eof - _test_eof49: - cs = 49 - goto _test_eof - _test_eof50: - cs = 50 - goto _test_eof - _test_eof51: - cs = 51 - goto _test_eof - _test_eof52: - cs = 52 - goto _test_eof - _test_eof53: - cs = 53 - goto _test_eof - _test_eof54: - cs = 54 - goto _test_eof - _test_eof55: - cs = 55 - goto _test_eof - _test_eof56: - cs = 56 - goto _test_eof - _test_eof57: - cs = 57 - goto _test_eof - _test_eof58: - cs = 58 - goto _test_eof - _test_eof59: - cs = 59 - goto _test_eof - _test_eof60: - cs = 60 - goto _test_eof - _test_eof61: - cs = 61 - goto _test_eof - _test_eof62: - cs = 62 - goto _test_eof - _test_eof63: - cs = 63 - goto _test_eof - _test_eof64: - cs = 64 - goto _test_eof - _test_eof65: - cs = 65 - goto _test_eof - _test_eof66: - cs = 66 - goto _test_eof - _test_eof67: - cs = 67 - goto _test_eof - _test_eof68: - cs = 68 - goto _test_eof - _test_eof69: - cs = 69 - goto _test_eof - _test_eof70: - cs = 70 - goto _test_eof - _test_eof71: - cs = 71 - goto _test_eof - _test_eof72: - cs = 72 - goto _test_eof - _test_eof73: - cs = 73 - goto _test_eof - _test_eof74: - cs = 74 - goto _test_eof - _test_eof75: - cs = 75 - goto _test_eof - _test_eof76: - cs = 76 - goto _test_eof - _test_eof77: - cs = 77 - goto _test_eof - _test_eof78: - cs = 78 - goto _test_eof - _test_eof79: - cs = 79 - goto _test_eof - _test_eof80: - cs = 80 - goto _test_eof - _test_eof81: - cs = 81 - goto _test_eof - _test_eof82: - cs = 82 - goto _test_eof - _test_eof83: - cs = 83 - goto _test_eof - _test_eof84: - cs = 84 - goto _test_eof - _test_eof85: - cs = 85 - goto _test_eof - _test_eof86: - cs = 86 - goto _test_eof - _test_eof87: - cs = 87 - goto _test_eof - _test_eof88: - cs = 88 - goto _test_eof - _test_eof89: - cs = 89 - goto _test_eof - _test_eof90: - cs = 90 - goto _test_eof - _test_eof91: - cs = 91 - goto _test_eof - _test_eof92: - cs = 92 - goto _test_eof - _test_eof93: - cs = 93 - goto _test_eof - _test_eof94: - cs = 94 - goto _test_eof - _test_eof95: - cs = 95 - goto _test_eof - _test_eof96: - cs = 96 - goto _test_eof - _test_eof97: - cs = 97 - goto _test_eof - _test_eof98: - cs = 98 - goto _test_eof - _test_eof99: - cs = 99 - goto _test_eof - _test_eof100: - cs = 100 - goto _test_eof - _test_eof101: - cs = 101 - goto _test_eof - _test_eof102: - cs = 102 - goto _test_eof - _test_eof103: - cs = 103 - goto _test_eof - _test_eof104: - cs = 104 - goto _test_eof - _test_eof105: - cs = 105 - goto _test_eof - _test_eof106: - cs = 106 - goto _test_eof - _test_eof107: - cs = 107 - goto _test_eof - _test_eof108: - cs = 108 - goto _test_eof - _test_eof109: - cs = 109 - goto _test_eof - _test_eof110: - cs = 110 - goto _test_eof - _test_eof111: - cs = 111 - goto _test_eof - _test_eof112: - cs = 112 - goto _test_eof - _test_eof113: - cs = 113 - goto _test_eof - _test_eof114: - cs = 114 - goto _test_eof - _test_eof115: - cs = 115 - goto _test_eof - _test_eof116: - cs = 116 - goto _test_eof - _test_eof117: - cs = 117 - goto _test_eof - _test_eof118: - cs = 118 - goto _test_eof - _test_eof119: - cs = 119 - goto _test_eof - _test_eof120: - cs = 120 - goto _test_eof - _test_eof121: - cs = 121 - goto _test_eof - _test_eof122: - cs = 122 - goto _test_eof - _test_eof123: - cs = 123 - goto _test_eof - _test_eof124: - cs = 124 - goto _test_eof - _test_eof125: - cs = 125 - goto _test_eof - _test_eof126: - cs = 126 - goto _test_eof - _test_eof127: - cs = 127 - goto _test_eof - _test_eof128: - cs = 128 - goto _test_eof - _test_eof129: - cs = 129 - goto _test_eof - _test_eof130: - cs = 130 - goto _test_eof - _test_eof131: - cs = 131 - goto _test_eof - _test_eof132: - cs = 132 - goto _test_eof - _test_eof133: - cs = 133 - goto _test_eof - _test_eof134: - cs = 134 - goto _test_eof - _test_eof135: - cs = 135 - goto _test_eof - _test_eof136: - cs = 136 - goto _test_eof - _test_eof137: - cs = 137 - goto _test_eof - _test_eof138: - cs = 138 - goto _test_eof - _test_eof139: - cs = 139 - goto _test_eof - _test_eof140: - cs = 140 - goto _test_eof - _test_eof141: - cs = 141 - goto _test_eof - _test_eof142: - cs = 142 - goto _test_eof - _test_eof143: - cs = 143 - goto _test_eof - _test_eof144: - cs = 144 - goto _test_eof - _test_eof145: - cs = 145 - goto _test_eof - _test_eof146: - cs = 146 - goto _test_eof - _test_eof147: - cs = 147 - goto _test_eof - _test_eof148: - cs = 148 - goto _test_eof - _test_eof149: - cs = 149 - goto _test_eof - _test_eof150: - cs = 150 - goto _test_eof - _test_eof151: - cs = 151 - goto _test_eof - _test_eof152: - cs = 152 - goto _test_eof - _test_eof153: - cs = 153 - goto _test_eof - _test_eof154: - cs = 154 - goto _test_eof - _test_eof155: - cs = 155 - goto _test_eof - _test_eof156: - cs = 156 - goto _test_eof - _test_eof157: - cs = 157 - goto _test_eof - _test_eof158: - cs = 158 - goto _test_eof - _test_eof159: - cs = 159 - goto _test_eof - _test_eof160: - cs = 160 - goto _test_eof - _test_eof161: - cs = 161 - goto _test_eof - _test_eof162: - cs = 162 - goto _test_eof - _test_eof163: - cs = 163 - goto _test_eof - _test_eof164: - cs = 164 - goto _test_eof - _test_eof165: - cs = 165 - goto _test_eof - _test_eof166: - cs = 166 - goto _test_eof - _test_eof167: - cs = 167 - goto _test_eof - _test_eof168: - cs = 168 - goto _test_eof - _test_eof169: - cs = 169 - goto _test_eof - _test_eof170: - cs = 170 - goto _test_eof - _test_eof171: - cs = 171 - goto _test_eof - _test_eof172: - cs = 172 - goto _test_eof - _test_eof173: - cs = 173 - goto _test_eof - _test_eof174: - cs = 174 - goto _test_eof - _test_eof175: - cs = 175 - goto _test_eof - _test_eof176: - cs = 176 - goto _test_eof - _test_eof177: - cs = 177 - goto _test_eof - _test_eof178: - cs = 178 - goto _test_eof - _test_eof179: - cs = 179 - goto _test_eof - _test_eof180: - cs = 180 - goto _test_eof - _test_eof181: - cs = 181 - goto _test_eof - _test_eof182: - cs = 182 - goto _test_eof - _test_eof183: - cs = 183 - goto _test_eof - _test_eof184: - cs = 184 - goto _test_eof - _test_eof185: - cs = 185 - goto _test_eof - _test_eof186: - cs = 186 - goto _test_eof - _test_eof187: - cs = 187 - goto _test_eof - _test_eof188: - cs = 188 - goto _test_eof - _test_eof189: - cs = 189 - goto _test_eof - _test_eof190: - cs = 190 - goto _test_eof - _test_eof191: - cs = 191 - goto _test_eof - _test_eof192: - cs = 192 - goto _test_eof - _test_eof193: - cs = 193 - goto _test_eof - _test_eof194: - cs = 194 - goto _test_eof - _test_eof195: - cs = 195 - goto _test_eof - _test_eof196: - cs = 196 - goto _test_eof - _test_eof197: - cs = 197 - goto _test_eof - _test_eof198: - cs = 198 - goto _test_eof - _test_eof199: - cs = 199 - goto _test_eof - _test_eof200: - cs = 200 - goto _test_eof - _test_eof201: - cs = 201 - goto _test_eof - _test_eof202: - cs = 202 - goto _test_eof - _test_eof203: - cs = 203 - goto _test_eof - _test_eof204: - cs = 204 - goto _test_eof - _test_eof205: - cs = 205 - goto _test_eof - _test_eof206: - cs = 206 - goto _test_eof - _test_eof207: - cs = 207 - goto _test_eof - _test_eof208: - cs = 208 - goto _test_eof - _test_eof209: - cs = 209 - goto _test_eof - _test_eof210: - cs = 210 - goto _test_eof - _test_eof211: - cs = 211 - goto _test_eof - _test_eof212: - cs = 212 - goto _test_eof - _test_eof213: - cs = 213 - goto _test_eof - _test_eof214: - cs = 214 - goto _test_eof - _test_eof215: - cs = 215 - goto _test_eof - _test_eof216: - cs = 216 - goto _test_eof - _test_eof217: - cs = 217 - goto _test_eof - _test_eof218: - cs = 218 - goto _test_eof - _test_eof219: - cs = 219 - goto _test_eof - _test_eof220: - cs = 220 - goto _test_eof - _test_eof221: - cs = 221 - goto _test_eof - _test_eof222: - cs = 222 - goto _test_eof - _test_eof223: - cs = 223 - goto _test_eof - _test_eof224: - cs = 224 - goto _test_eof - _test_eof225: - cs = 225 - goto _test_eof - _test_eof226: - cs = 226 - goto _test_eof - _test_eof227: - cs = 227 - goto _test_eof - _test_eof228: - cs = 228 - goto _test_eof - _test_eof229: - cs = 229 - goto _test_eof - _test_eof230: - cs = 230 - goto _test_eof - _test_eof231: - cs = 231 - goto _test_eof - _test_eof232: - cs = 232 - goto _test_eof - _test_eof233: - cs = 233 - goto _test_eof - _test_eof234: - cs = 234 - goto _test_eof - _test_eof235: - cs = 235 - goto _test_eof - _test_eof236: - cs = 236 - goto _test_eof - _test_eof237: - cs = 237 - goto _test_eof - _test_eof238: - cs = 238 - goto _test_eof - _test_eof239: - cs = 239 - goto _test_eof - _test_eof240: - cs = 240 - goto _test_eof - _test_eof241: - cs = 241 - goto _test_eof - _test_eof242: - cs = 242 - goto _test_eof - _test_eof243: - cs = 243 - goto _test_eof - _test_eof244: - cs = 244 - goto _test_eof - _test_eof245: - cs = 245 - goto _test_eof - _test_eof246: - cs = 246 - goto _test_eof - _test_eof247: - cs = 247 - goto _test_eof - _test_eof248: - cs = 248 - goto _test_eof - _test_eof249: - cs = 249 - goto _test_eof - _test_eof250: - cs = 250 - goto _test_eof - _test_eof251: - cs = 251 - goto _test_eof - _test_eof252: - cs = 252 - goto _test_eof - _test_eof253: - cs = 253 - goto _test_eof - _test_eof254: - cs = 254 - goto _test_eof - _test_eof255: - cs = 255 - goto _test_eof - _test_eof256: - cs = 256 - goto _test_eof - _test_eof257: - cs = 257 - goto _test_eof - _test_eof258: - cs = 258 - goto _test_eof - _test_eof259: - cs = 259 - goto _test_eof - _test_eof260: - cs = 260 - goto _test_eof - _test_eof261: - cs = 261 - goto _test_eof - _test_eof262: - cs = 262 - goto _test_eof - _test_eof263: - cs = 263 - goto _test_eof - _test_eof264: - cs = 264 - goto _test_eof - _test_eof265: - cs = 265 - goto _test_eof - _test_eof266: - cs = 266 - goto _test_eof - _test_eof267: - cs = 267 - goto _test_eof - _test_eof268: - cs = 268 - goto _test_eof - _test_eof269: - cs = 269 - goto _test_eof - _test_eof270: - cs = 270 - goto _test_eof - _test_eof271: - cs = 271 - goto _test_eof - _test_eof272: - cs = 272 - goto _test_eof - _test_eof273: - cs = 273 - goto _test_eof - _test_eof274: - cs = 274 - goto _test_eof - _test_eof275: - cs = 275 - goto _test_eof - _test_eof276: - cs = 276 - goto _test_eof - _test_eof277: - cs = 277 - goto _test_eof - _test_eof278: - cs = 278 - goto _test_eof - _test_eof279: - cs = 279 - goto _test_eof - _test_eof280: - cs = 280 - goto _test_eof - _test_eof281: - cs = 281 - goto _test_eof - _test_eof282: - cs = 282 - goto _test_eof - _test_eof283: - cs = 283 - goto _test_eof - _test_eof284: - cs = 284 - goto _test_eof - _test_eof285: - cs = 285 - goto _test_eof - _test_eof286: - cs = 286 - goto _test_eof - _test_eof287: - cs = 287 - goto _test_eof - _test_eof288: - cs = 288 - goto _test_eof - _test_eof289: - cs = 289 - goto _test_eof - _test_eof290: - cs = 290 - goto _test_eof - _test_eof291: - cs = 291 - goto _test_eof - _test_eof292: - cs = 292 - goto _test_eof - _test_eof293: - cs = 293 - goto _test_eof - _test_eof294: - cs = 294 - goto _test_eof - _test_eof295: - cs = 295 - goto _test_eof - _test_eof296: - cs = 296 - goto _test_eof - _test_eof297: - cs = 297 - goto _test_eof - _test_eof298: - cs = 298 - goto _test_eof - _test_eof299: - cs = 299 - goto _test_eof - _test_eof300: - cs = 300 - goto _test_eof - _test_eof301: - cs = 301 - goto _test_eof - _test_eof302: - cs = 302 - goto _test_eof - _test_eof303: - cs = 303 - goto _test_eof - _test_eof304: - cs = 304 - goto _test_eof - _test_eof305: - cs = 305 + goto tr0 + st17: + if p++; p == pe { + goto _test_eof17 + } + st_case_17: + if data[p] == 32 { + goto st17 + } + if 48 <= data[p] && data[p] <= 57 { + goto st18 + } + goto tr0 + st18: + if p++; p == pe { + goto _test_eof18 + } + st_case_18: + if data[p] == 58 { + goto st19 + } + if 48 <= data[p] && data[p] <= 57 { + goto st18 + } + goto tr0 + st19: + if p++; p == pe { + goto _test_eof19 + } + st_case_19: + if 48 <= data[p] && data[p] <= 57 { + goto st20 + } + goto tr0 + st20: + if p++; p == pe { + goto _test_eof20 + } + st_case_20: + if data[p] == 58 { + goto st21 + } + if 48 <= data[p] && data[p] <= 57 { + goto st20 + } + goto tr0 + st21: + if p++; p == pe { + goto _test_eof21 + } + st_case_21: + if 48 <= data[p] && data[p] <= 57 { + goto st22 + } + goto tr0 + st22: + if p++; p == pe { + goto _test_eof22 + } + st_case_22: + if data[p] == 32 { + goto tr30 + } + if 48 <= data[p] && data[p] <= 57 { + goto st22 + } + goto tr0 + tr3: +//line parser/common.rl:4 + + tok = p + + goto st23 + st23: + if p++; p == pe { + goto _test_eof23 + } + st_case_23: +//line rfc3164_gen.go:800 + if data[p] == 32 { + goto st15 + } + switch { + case data[p] > 90: + if 97 <= data[p] && data[p] <= 122 { + goto st23 + } + case data[p] >= 65: + goto st23 + } + goto tr0 + st_out: + _test_eof2: + cs = 2 goto _test_eof - _test_eof306: - cs = 306 + _test_eof3: + cs = 3 goto _test_eof - _test_eof307: - cs = 307 + _test_eof4: + cs = 4 goto _test_eof - _test_eof308: - cs = 308 + _test_eof5: + cs = 5 goto _test_eof - _test_eof309: - cs = 309 + _test_eof6: + cs = 6 goto _test_eof - _test_eof310: - cs = 310 + _test_eof24: + cs = 24 goto _test_eof - _test_eof311: - cs = 311 + _test_eof25: + cs = 25 goto _test_eof - _test_eof312: - cs = 312 + _test_eof26: + cs = 26 goto _test_eof - _test_eof313: - cs = 313 + _test_eof27: + cs = 27 goto _test_eof - _test_eof314: - cs = 314 + _test_eof28: + cs = 28 goto _test_eof - _test_eof315: - cs = 315 + _test_eof29: + cs = 29 goto _test_eof - _test_eof316: - cs = 316 + _test_eof30: + cs = 30 goto _test_eof - _test_eof317: - cs = 317 + _test_eof31: + cs = 31 goto _test_eof - _test_eof318: - cs = 318 + _test_eof32: + cs = 32 goto _test_eof - _test_eof319: - cs = 319 + _test_eof7: + cs = 7 goto _test_eof - _test_eof320: - cs = 320 + _test_eof8: + cs = 8 goto _test_eof - _test_eof321: - cs = 321 + _test_eof9: + cs = 9 goto _test_eof - _test_eof322: - cs = 322 + _test_eof10: + cs = 10 goto _test_eof - _test_eof323: - cs = 323 + _test_eof11: + cs = 11 goto _test_eof - _test_eof324: - cs = 324 + _test_eof12: + cs = 12 goto _test_eof - _test_eof325: - cs = 325 + _test_eof13: + cs = 13 goto _test_eof - _test_eof326: - cs = 326 + _test_eof14: + cs = 14 goto _test_eof - _test_eof327: - cs = 327 + _test_eof15: + cs = 15 goto _test_eof - _test_eof328: - cs = 328 + _test_eof16: + cs = 16 goto _test_eof - _test_eof329: - cs = 329 + _test_eof17: + cs = 17 goto _test_eof - _test_eof330: - cs = 330 + _test_eof18: + cs = 18 goto _test_eof - _test_eof331: - cs = 331 + _test_eof19: + cs = 19 goto _test_eof - _test_eof332: - cs = 332 + _test_eof20: + cs = 20 goto _test_eof - _test_eof333: - cs = 333 + _test_eof21: + cs = 21 goto _test_eof - _test_eof334: - cs = 334 + _test_eof22: + cs = 22 goto _test_eof - _test_eof335: - cs = 335 + _test_eof23: + cs = 23 goto _test_eof _test_eof: @@ -6601,30 +920,18 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } if p == eof { switch cs { - case 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375: -//line parser/common.rl:24 + case 24, 25, 26, 27, 28, 29, 30, 31, 32: +//line parser/common.rl:30 m.setMsg(data[tok:p]) - case 1, 2, 3, 333, 334, 335: -//line parser/common.rl:36 + case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23: +//line parser/common.rl:42 - err = ErrPriority + errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) p-- - case 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332: -//line parser/common.rl:41 - - err = ErrTimestamp - p-- - - case 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286: -//line parser/common.rl:46 - - err = ErrHostname - p-- - -//line rfc3164_gen.go:5872 +//line rfc3164_gen.go:861 } } @@ -6633,11 +940,7 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } } -//line parser/parser_rfc3164.rl:32 - - if err != nil { - return message{}, err - } +//line parser/parser_rfc3164.rl:36 - return m, nil + return m, errs } diff --git a/libbeat/reader/syslog/rfc3164_test.go b/libbeat/reader/syslog/rfc3164_test.go index 2d0aec25b582..8b938d596ecf 100644 --- a/libbeat/reader/syslog/rfc3164_test.go +++ b/libbeat/reader/syslog/rfc3164_test.go @@ -24,123 +24,212 @@ import ( "github.com/stretchr/testify/assert" ) -var parseRFC3164Cases = map[string]struct { - In string - Want message - WantErr error -}{ - "ok": { - In: "<13>Oct 11 22:14:15 test-host this is the message", - Want: message{ - timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), - priority: 13, - facility: 1, - severity: 5, - hostname: "test-host", - msg: "this is the message", - }, - }, - "ok-rfc3339": { - In: "<13>2003-08-24T05:14:15.000003-07:00 test-host this is the message", - Want: message{ - timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), - priority: 13, - facility: 1, - severity: 5, - hostname: "test-host", - msg: "this is the message", - }, - }, - "ok-process": { - In: "<13>Oct 11 22:14:15 test-host su: this is the message", - Want: message{ - timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), - priority: 13, - facility: 1, - severity: 5, - hostname: "test-host", - process: "su", - msg: "this is the message", - }, - }, - "ok-process-pid": { - In: "<13>Oct 11 22:14:15 test-host su[1024]: this is the message", - Want: message{ - timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), - priority: 13, - facility: 1, - severity: 5, - hostname: "test-host", - process: "su", - pid: "1024", - msg: "this is the message", - }, - }, - "non-standard-date": { - In: "<123>Sep 01 02:03:04 hostname message", - Want: message{ - timestamp: mustParseTime(time.Stamp, "Sep 1 02:03:04", time.Local), - priority: 123, - facility: 15, - severity: 3, - hostname: "hostname", - msg: "message", - }, - }, - "err-pri-not-a-number": { - In: "Oct 11 22:14:15 test-host this is the message", - WantErr: ErrPriority, - }, - "err-pri-out-of-range": { - In: "<192>Oct 11 22:14:15 test-host this is the message", - WantErr: ErrPriority, - }, - "err-pri-negative": { - In: "<-1>Oct 11 22:14:15 test-host this is the message", - WantErr: ErrPriority, - }, - "err-pri-missing-brackets": { - In: "13 Oct 11 22:14:15 test-host this is the message", - WantErr: ErrPriority, - }, - "err-ts-invalid-missing": { - In: "<13> test-host this is the message", - WantErr: ErrTimestamp, - }, - "err-ts-invalid-bsd": { - In: "<13>Foo 11 22:14:15 test-host this is the message", - WantErr: ErrTimestamp, - }, - "err-ts-invalid-rfc3339": { - In: "<13>2003-08-24 05:14:15-07:00 test-host this is the message", - WantErr: ErrTimestamp, - }, - "err-hostname-too-long": { - In: "<13>Oct 11 22:14:15 abcdefghijklmnopqrstuvwxyz12345.abcdefghijklmnopqrstuvwxyz12345.abcdefghijklmnopqrstuvwxyz12345.abcdefghijklmnopqrstuvwxyz12345.abcdefghijklmnopqrstuvwxyz12345.abcdefghijklmnopqrstuvwxyz12345.abcdefghijklmnopqrstuvwxyz12345.abcdefghijklmnopqrstuvwxyz1234567 this is the message", - WantErr: ErrHostname, - }, -} - func TestParseRFC3164(t *testing.T) { - for name, tc := range parseRFC3164Cases { + tests := map[string]struct { + In string + Want message + WantErr string + }{ + "ok": { + In: "<13>Oct 11 22:14:15 test-host this is the message", + Want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + msg: "this is the message", + }, + }, + "ok-rfc3339": { + In: "<13>2003-08-24T05:14:15.000003-07:00 test-host this is the message", + Want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + msg: "this is the message", + }, + }, + "ok-process": { + In: "<13>Oct 11 22:14:15 test-host su: this is the message", + Want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + process: "su", + msg: "this is the message", + }, + }, + "ok-process-pid": { + In: "<13>Oct 11 22:14:15 test-host su[1024]: this is the message", + Want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + process: "su", + pid: "1024", + msg: "this is the message", + }, + }, + "non-standard-date": { + In: "<123>Sep 01 02:03:04 hostname message", + Want: message{ + timestamp: mustParseTime(time.Stamp, "Sep 1 02:03:04", time.Local), + priority: 123, + facility: 15, + severity: 3, + hostname: "hostname", + msg: "message", + }, + }, + "err-pri-not-a-number": { + In: "Oct 11 22:14:15 test-host this is the message", + Want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: -1, + hostname: "test-host", + msg: "this is the message", + }, + WantErr: `validation error at position 2: invalid priority: strconv.Atoi: parsing "abc": invalid syntax`, + }, + "err-pri-out-of-range": { + In: "<192>Oct 11 22:14:15 test-host this is the message", + Want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: -1, + hostname: "test-host", + msg: "this is the message", + }, + WantErr: ErrPriority.Error(), + }, + "err-pri-negative": { + In: "<-1>Oct 11 22:14:15 test-host this is the message", + Want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: -1, + hostname: "test-host", + msg: "this is the message", + }, + WantErr: ErrPriority.Error(), + }, + "err-pri-missing-brackets": { + In: "13 Oct 11 22:14:15 test-host this is the message", + Want: message{ + priority: -1, + hostname: "Oct", + msg: "11 22:14:15 test-host this is the message", + }, + WantErr: `validation error at position 1: parsing time "13" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "13" as "2006"`, + }, + "err-ts-invalid-missing": { + In: "<13> test-host this is the message", + Want: message{ + priority: 13, + facility: 1, + severity: 5, + }, + WantErr: ErrEOF.Error(), + }, + "err-ts-invalid-bsd": { + In: "<13>Foo 11 22:14:15 test-host this is the message", + Want: message{ + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + msg: "this is the message", + }, + WantErr: `validation error at position 5: parsing time "Foo 11 22:14:15" as "Jan _2 15:04:05": cannot parse "Foo 11 22:14:15" as "Jan"`, + }, + "err-ts-invalid-rfc3339": { + In: "<13>24-08-2003T05:14:15-07:00 test-host this is the message", + Want: message{ + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + msg: "this is the message", + }, + WantErr: `validation error at position 5: parsing time "24-08-2003T05:14:15-07:00" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "8-2003T05:14:15-07:00" as "2006"`, + }, + "err-eof": { + In: "<13>Oct 11 22:14:15 test-", + Want: message{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + priority: 13, + facility: 1, + severity: 5, + }, + WantErr: `parsing error at position 26: message is truncated (unexpected EOF)`, + }, + } + + for name, tc := range tests { tc := tc t.Run(name, func(t *testing.T) { t.Parallel() got, gotErr := parseRFC3164(tc.In, time.Local) - if tc.WantErr != nil { - assert.Equal(t, tc.WantErr, gotErr) + if tc.WantErr != "" { + assert.ErrorContains(t, gotErr, tc.WantErr) } else { - assert.Nil(t, gotErr) - assert.Equal(t, tc.Want, got) + assert.NoError(t, gotErr) } + assert.Equal(t, tc.Want, got) }) } } func BenchmarkParseRFC3164(b *testing.B) { - for name, bc := range parseRFC3164Cases { + tests := map[string]struct { + In string + }{ + "ok": { + In: "<13>Oct 11 22:14:15 test-host this is the message", + }, + "ok-rfc3339": { + In: "<13>2003-08-24T05:14:15.000003-07:00 test-host this is the message", + }, + "ok-process": { + In: "<13>Oct 11 22:14:15 test-host su: this is the message", + }, + "ok-process-pid": { + In: "<13>Oct 11 22:14:15 test-host su[1024]: this is the message", + }, + "non-standard-date": { + In: "<123>Sep 01 02:03:04 hostname message", + }, + "err-pri-not-a-number": { + In: "Oct 11 22:14:15 test-host this is the message", + }, + "err-pri-out-of-range": { + In: "<192>Oct 11 22:14:15 test-host this is the message", + }, + "err-pri-negative": { + In: "<-1>Oct 11 22:14:15 test-host this is the message", + }, + "err-pri-missing-brackets": { + In: "13 Oct 11 22:14:15 test-host this is the message", + }, + "err-ts-invalid-missing": { + In: "<13> test-host this is the message", + }, + "err-ts-invalid-bsd": { + In: "<13>Foo 11 22:14:15 test-host this is the message", + }, + "err-ts-invalid-rfc3339": { + In: "<13>2003-08-24 05:14:15-07:00 test-host this is the message", + }, + } + + for name, bc := range tests { bc := bc b.Run(name, func(b *testing.B) { b.ReportAllocs() diff --git a/libbeat/reader/syslog/rfc5424_gen.go b/libbeat/reader/syslog/rfc5424_gen.go index 5ae34bff544d..e38f84859723 100644 --- a/libbeat/reader/syslog/rfc5424_gen.go +++ b/libbeat/reader/syslog/rfc5424_gen.go @@ -19,14 +19,16 @@ // Code generated by ragel. DO NOT EDIT. package syslog -//line rfc5424_gen.go:8 +import "go.uber.org/multierr" + +//line rfc5424_gen.go:10 const rfc5424_start int = 1 -const rfc5424_first_final int = 589 +const rfc5424_first_final int = 23 const rfc5424_error int = 0 const rfc5424_en_main int = 1 -//line parser/parser_rfc5424.rl:8 +//line parser/parser_rfc5424.rl:10 type machineState struct { sdID string @@ -36,20 +38,21 @@ type machineState struct { // ParseRFC5424 parses an RFC 5424-formatted syslog message. func parseRFC5424(data string) (message, error) { - var m message - var s machineState - var err error + var errs error var p, cs, tok int pe := len(data) eof := len(data) + m := message{ + priority: -1, + } -//line rfc5424_gen.go:36 +//line rfc5424_gen.go:39 { cs = rfc5424_start } -//line rfc5424_gen.go:41 +//line rfc5424_gen.go:44 { if p == pe { goto _test_eof @@ -89,30 +92,16 @@ func parseRFC5424(data string) (message, error) { goto st_case_15 case 16: goto st_case_16 - case 589: - goto st_case_589 - case 590: - goto st_case_590 - case 591: - goto st_case_591 - case 17: - goto st_case_17 - case 18: - goto st_case_18 - case 19: - goto st_case_19 - case 20: - goto st_case_20 - case 21: - goto st_case_21 - case 22: - goto st_case_22 case 23: goto st_case_23 case 24: goto st_case_24 case 25: goto st_case_25 + case 17: + goto st_case_17 + case 18: + goto st_case_18 case 26: goto st_case_26 case 27: @@ -121,1126 +110,14 @@ func parseRFC5424(data string) (message, error) { goto st_case_28 case 29: goto st_case_29 - case 30: - goto st_case_30 - case 31: - goto st_case_31 - case 32: - goto st_case_32 - case 33: - goto st_case_33 - case 34: - goto st_case_34 - case 35: - goto st_case_35 - case 36: - goto st_case_36 - case 37: - goto st_case_37 - case 38: - goto st_case_38 - case 39: - goto st_case_39 - case 40: - goto st_case_40 - case 41: - goto st_case_41 - case 42: - goto st_case_42 - case 43: - goto st_case_43 - case 44: - goto st_case_44 - case 45: - goto st_case_45 - case 46: - goto st_case_46 - case 47: - goto st_case_47 - case 48: - goto st_case_48 - case 49: - goto st_case_49 - case 50: - goto st_case_50 - case 51: - goto st_case_51 - case 52: - goto st_case_52 - case 53: - goto st_case_53 - case 54: - goto st_case_54 - case 55: - goto st_case_55 - case 592: - goto st_case_592 - case 56: - goto st_case_56 - case 57: - goto st_case_57 - case 58: - goto st_case_58 - case 59: - goto st_case_59 - case 60: - goto st_case_60 - case 61: - goto st_case_61 - case 62: - goto st_case_62 - case 63: - goto st_case_63 - case 64: - goto st_case_64 - case 65: - goto st_case_65 - case 66: - goto st_case_66 - case 67: - goto st_case_67 - case 68: - goto st_case_68 - case 69: - goto st_case_69 - case 70: - goto st_case_70 - case 71: - goto st_case_71 - case 72: - goto st_case_72 - case 73: - goto st_case_73 - case 74: - goto st_case_74 - case 75: - goto st_case_75 - case 76: - goto st_case_76 - case 77: - goto st_case_77 - case 78: - goto st_case_78 - case 79: - goto st_case_79 - case 80: - goto st_case_80 - case 81: - goto st_case_81 - case 82: - goto st_case_82 - case 83: - goto st_case_83 - case 84: - goto st_case_84 - case 85: - goto st_case_85 - case 86: - goto st_case_86 - case 87: - goto st_case_87 - case 88: - goto st_case_88 - case 89: - goto st_case_89 - case 90: - goto st_case_90 - case 91: - goto st_case_91 - case 92: - goto st_case_92 - case 93: - goto st_case_93 - case 94: - goto st_case_94 - case 95: - goto st_case_95 - case 96: - goto st_case_96 - case 97: - goto st_case_97 - case 98: - goto st_case_98 - case 99: - goto st_case_99 - case 100: - goto st_case_100 - case 101: - goto st_case_101 - case 102: - goto st_case_102 - case 103: - goto st_case_103 - case 104: - goto st_case_104 - case 105: - goto st_case_105 - case 106: - goto st_case_106 - case 107: - goto st_case_107 - case 108: - goto st_case_108 - case 109: - goto st_case_109 - case 110: - goto st_case_110 - case 111: - goto st_case_111 - case 112: - goto st_case_112 - case 113: - goto st_case_113 - case 114: - goto st_case_114 - case 115: - goto st_case_115 - case 116: - goto st_case_116 - case 117: - goto st_case_117 - case 118: - goto st_case_118 - case 119: - goto st_case_119 - case 120: - goto st_case_120 - case 121: - goto st_case_121 - case 122: - goto st_case_122 - case 123: - goto st_case_123 - case 124: - goto st_case_124 - case 125: - goto st_case_125 - case 126: - goto st_case_126 - case 127: - goto st_case_127 - case 128: - goto st_case_128 - case 129: - goto st_case_129 - case 130: - goto st_case_130 - case 131: - goto st_case_131 - case 132: - goto st_case_132 - case 133: - goto st_case_133 - case 134: - goto st_case_134 - case 135: - goto st_case_135 - case 136: - goto st_case_136 - case 137: - goto st_case_137 - case 138: - goto st_case_138 - case 139: - goto st_case_139 - case 140: - goto st_case_140 - case 141: - goto st_case_141 - case 142: - goto st_case_142 - case 143: - goto st_case_143 - case 144: - goto st_case_144 - case 145: - goto st_case_145 - case 146: - goto st_case_146 - case 147: - goto st_case_147 - case 148: - goto st_case_148 - case 149: - goto st_case_149 - case 150: - goto st_case_150 - case 151: - goto st_case_151 - case 152: - goto st_case_152 - case 153: - goto st_case_153 - case 154: - goto st_case_154 - case 155: - goto st_case_155 - case 156: - goto st_case_156 - case 157: - goto st_case_157 - case 158: - goto st_case_158 - case 159: - goto st_case_159 - case 160: - goto st_case_160 - case 161: - goto st_case_161 - case 162: - goto st_case_162 - case 163: - goto st_case_163 - case 164: - goto st_case_164 - case 165: - goto st_case_165 - case 166: - goto st_case_166 - case 167: - goto st_case_167 - case 168: - goto st_case_168 - case 169: - goto st_case_169 - case 170: - goto st_case_170 - case 171: - goto st_case_171 - case 172: - goto st_case_172 - case 173: - goto st_case_173 - case 174: - goto st_case_174 - case 175: - goto st_case_175 - case 176: - goto st_case_176 - case 177: - goto st_case_177 - case 178: - goto st_case_178 - case 179: - goto st_case_179 - case 180: - goto st_case_180 - case 181: - goto st_case_181 - case 182: - goto st_case_182 - case 183: - goto st_case_183 - case 184: - goto st_case_184 - case 185: - goto st_case_185 - case 186: - goto st_case_186 - case 187: - goto st_case_187 - case 188: - goto st_case_188 - case 189: - goto st_case_189 - case 190: - goto st_case_190 - case 191: - goto st_case_191 - case 192: - goto st_case_192 - case 193: - goto st_case_193 - case 194: - goto st_case_194 - case 195: - goto st_case_195 - case 196: - goto st_case_196 - case 197: - goto st_case_197 - case 198: - goto st_case_198 - case 199: - goto st_case_199 - case 200: - goto st_case_200 - case 201: - goto st_case_201 - case 202: - goto st_case_202 - case 203: - goto st_case_203 - case 204: - goto st_case_204 - case 205: - goto st_case_205 - case 206: - goto st_case_206 - case 207: - goto st_case_207 - case 208: - goto st_case_208 - case 209: - goto st_case_209 - case 210: - goto st_case_210 - case 211: - goto st_case_211 - case 212: - goto st_case_212 - case 213: - goto st_case_213 - case 214: - goto st_case_214 - case 215: - goto st_case_215 - case 216: - goto st_case_216 - case 217: - goto st_case_217 - case 218: - goto st_case_218 - case 219: - goto st_case_219 - case 220: - goto st_case_220 - case 221: - goto st_case_221 - case 222: - goto st_case_222 - case 223: - goto st_case_223 - case 224: - goto st_case_224 - case 225: - goto st_case_225 - case 226: - goto st_case_226 - case 227: - goto st_case_227 - case 228: - goto st_case_228 - case 229: - goto st_case_229 - case 230: - goto st_case_230 - case 231: - goto st_case_231 - case 232: - goto st_case_232 - case 233: - goto st_case_233 - case 234: - goto st_case_234 - case 235: - goto st_case_235 - case 236: - goto st_case_236 - case 237: - goto st_case_237 - case 238: - goto st_case_238 - case 239: - goto st_case_239 - case 240: - goto st_case_240 - case 241: - goto st_case_241 - case 242: - goto st_case_242 - case 243: - goto st_case_243 - case 244: - goto st_case_244 - case 245: - goto st_case_245 - case 246: - goto st_case_246 - case 247: - goto st_case_247 - case 248: - goto st_case_248 - case 249: - goto st_case_249 - case 250: - goto st_case_250 - case 251: - goto st_case_251 - case 252: - goto st_case_252 - case 253: - goto st_case_253 - case 254: - goto st_case_254 - case 255: - goto st_case_255 - case 256: - goto st_case_256 - case 257: - goto st_case_257 - case 258: - goto st_case_258 - case 259: - goto st_case_259 - case 260: - goto st_case_260 - case 261: - goto st_case_261 - case 262: - goto st_case_262 - case 263: - goto st_case_263 - case 264: - goto st_case_264 - case 265: - goto st_case_265 - case 266: - goto st_case_266 - case 267: - goto st_case_267 - case 268: - goto st_case_268 - case 269: - goto st_case_269 - case 270: - goto st_case_270 - case 271: - goto st_case_271 - case 272: - goto st_case_272 - case 273: - goto st_case_273 - case 274: - goto st_case_274 - case 275: - goto st_case_275 - case 276: - goto st_case_276 - case 277: - goto st_case_277 - case 278: - goto st_case_278 - case 279: - goto st_case_279 - case 280: - goto st_case_280 - case 281: - goto st_case_281 - case 282: - goto st_case_282 - case 283: - goto st_case_283 - case 284: - goto st_case_284 - case 285: - goto st_case_285 - case 286: - goto st_case_286 - case 287: - goto st_case_287 - case 288: - goto st_case_288 - case 289: - goto st_case_289 - case 290: - goto st_case_290 - case 291: - goto st_case_291 - case 292: - goto st_case_292 - case 293: - goto st_case_293 - case 294: - goto st_case_294 - case 295: - goto st_case_295 - case 296: - goto st_case_296 - case 297: - goto st_case_297 - case 298: - goto st_case_298 - case 299: - goto st_case_299 - case 300: - goto st_case_300 - case 301: - goto st_case_301 - case 302: - goto st_case_302 - case 303: - goto st_case_303 - case 304: - goto st_case_304 - case 305: - goto st_case_305 - case 306: - goto st_case_306 - case 307: - goto st_case_307 - case 308: - goto st_case_308 - case 309: - goto st_case_309 - case 310: - goto st_case_310 - case 311: - goto st_case_311 - case 312: - goto st_case_312 - case 313: - goto st_case_313 - case 314: - goto st_case_314 - case 315: - goto st_case_315 - case 316: - goto st_case_316 - case 317: - goto st_case_317 - case 318: - goto st_case_318 - case 319: - goto st_case_319 - case 320: - goto st_case_320 - case 321: - goto st_case_321 - case 322: - goto st_case_322 - case 323: - goto st_case_323 - case 324: - goto st_case_324 - case 325: - goto st_case_325 - case 326: - goto st_case_326 - case 327: - goto st_case_327 - case 328: - goto st_case_328 - case 329: - goto st_case_329 - case 330: - goto st_case_330 - case 331: - goto st_case_331 - case 332: - goto st_case_332 - case 333: - goto st_case_333 - case 334: - goto st_case_334 - case 335: - goto st_case_335 - case 336: - goto st_case_336 - case 337: - goto st_case_337 - case 338: - goto st_case_338 - case 339: - goto st_case_339 - case 340: - goto st_case_340 - case 341: - goto st_case_341 - case 342: - goto st_case_342 - case 343: - goto st_case_343 - case 344: - goto st_case_344 - case 345: - goto st_case_345 - case 346: - goto st_case_346 - case 347: - goto st_case_347 - case 348: - goto st_case_348 - case 349: - goto st_case_349 - case 350: - goto st_case_350 - case 351: - goto st_case_351 - case 352: - goto st_case_352 - case 353: - goto st_case_353 - case 354: - goto st_case_354 - case 355: - goto st_case_355 - case 356: - goto st_case_356 - case 357: - goto st_case_357 - case 358: - goto st_case_358 - case 359: - goto st_case_359 - case 360: - goto st_case_360 - case 361: - goto st_case_361 - case 362: - goto st_case_362 - case 363: - goto st_case_363 - case 364: - goto st_case_364 - case 365: - goto st_case_365 - case 366: - goto st_case_366 - case 367: - goto st_case_367 - case 368: - goto st_case_368 - case 369: - goto st_case_369 - case 370: - goto st_case_370 - case 371: - goto st_case_371 - case 372: - goto st_case_372 - case 373: - goto st_case_373 - case 374: - goto st_case_374 - case 375: - goto st_case_375 - case 376: - goto st_case_376 - case 377: - goto st_case_377 - case 378: - goto st_case_378 - case 379: - goto st_case_379 - case 380: - goto st_case_380 - case 381: - goto st_case_381 - case 382: - goto st_case_382 - case 383: - goto st_case_383 - case 384: - goto st_case_384 - case 385: - goto st_case_385 - case 386: - goto st_case_386 - case 387: - goto st_case_387 - case 388: - goto st_case_388 - case 389: - goto st_case_389 - case 390: - goto st_case_390 - case 391: - goto st_case_391 - case 392: - goto st_case_392 - case 393: - goto st_case_393 - case 394: - goto st_case_394 - case 395: - goto st_case_395 - case 396: - goto st_case_396 - case 397: - goto st_case_397 - case 398: - goto st_case_398 - case 399: - goto st_case_399 - case 400: - goto st_case_400 - case 401: - goto st_case_401 - case 402: - goto st_case_402 - case 403: - goto st_case_403 - case 404: - goto st_case_404 - case 405: - goto st_case_405 - case 406: - goto st_case_406 - case 407: - goto st_case_407 - case 408: - goto st_case_408 - case 409: - goto st_case_409 - case 410: - goto st_case_410 - case 411: - goto st_case_411 - case 412: - goto st_case_412 - case 413: - goto st_case_413 - case 414: - goto st_case_414 - case 415: - goto st_case_415 - case 416: - goto st_case_416 - case 417: - goto st_case_417 - case 418: - goto st_case_418 - case 419: - goto st_case_419 - case 420: - goto st_case_420 - case 421: - goto st_case_421 - case 422: - goto st_case_422 - case 423: - goto st_case_423 - case 424: - goto st_case_424 - case 425: - goto st_case_425 - case 426: - goto st_case_426 - case 427: - goto st_case_427 - case 428: - goto st_case_428 - case 429: - goto st_case_429 - case 430: - goto st_case_430 - case 431: - goto st_case_431 - case 432: - goto st_case_432 - case 433: - goto st_case_433 - case 434: - goto st_case_434 - case 435: - goto st_case_435 - case 436: - goto st_case_436 - case 437: - goto st_case_437 - case 438: - goto st_case_438 - case 439: - goto st_case_439 - case 440: - goto st_case_440 - case 441: - goto st_case_441 - case 442: - goto st_case_442 - case 443: - goto st_case_443 - case 444: - goto st_case_444 - case 445: - goto st_case_445 - case 446: - goto st_case_446 - case 447: - goto st_case_447 - case 448: - goto st_case_448 - case 449: - goto st_case_449 - case 450: - goto st_case_450 - case 451: - goto st_case_451 - case 452: - goto st_case_452 - case 453: - goto st_case_453 - case 454: - goto st_case_454 - case 455: - goto st_case_455 - case 456: - goto st_case_456 - case 457: - goto st_case_457 - case 458: - goto st_case_458 - case 459: - goto st_case_459 - case 460: - goto st_case_460 - case 461: - goto st_case_461 - case 462: - goto st_case_462 - case 463: - goto st_case_463 - case 464: - goto st_case_464 - case 465: - goto st_case_465 - case 466: - goto st_case_466 - case 467: - goto st_case_467 - case 468: - goto st_case_468 - case 469: - goto st_case_469 - case 470: - goto st_case_470 - case 471: - goto st_case_471 - case 472: - goto st_case_472 - case 473: - goto st_case_473 - case 474: - goto st_case_474 - case 475: - goto st_case_475 - case 476: - goto st_case_476 - case 477: - goto st_case_477 - case 478: - goto st_case_478 - case 479: - goto st_case_479 - case 480: - goto st_case_480 - case 481: - goto st_case_481 - case 482: - goto st_case_482 - case 483: - goto st_case_483 - case 484: - goto st_case_484 - case 485: - goto st_case_485 - case 486: - goto st_case_486 - case 487: - goto st_case_487 - case 488: - goto st_case_488 - case 489: - goto st_case_489 - case 490: - goto st_case_490 - case 491: - goto st_case_491 - case 492: - goto st_case_492 - case 493: - goto st_case_493 - case 494: - goto st_case_494 - case 495: - goto st_case_495 - case 496: - goto st_case_496 - case 497: - goto st_case_497 - case 498: - goto st_case_498 - case 499: - goto st_case_499 - case 500: - goto st_case_500 - case 501: - goto st_case_501 - case 502: - goto st_case_502 - case 503: - goto st_case_503 - case 504: - goto st_case_504 - case 505: - goto st_case_505 - case 506: - goto st_case_506 - case 507: - goto st_case_507 - case 508: - goto st_case_508 - case 509: - goto st_case_509 - case 510: - goto st_case_510 - case 511: - goto st_case_511 - case 512: - goto st_case_512 - case 513: - goto st_case_513 - case 514: - goto st_case_514 - case 515: - goto st_case_515 - case 516: - goto st_case_516 - case 517: - goto st_case_517 - case 518: - goto st_case_518 - case 519: - goto st_case_519 - case 520: - goto st_case_520 - case 521: - goto st_case_521 - case 522: - goto st_case_522 - case 523: - goto st_case_523 - case 524: - goto st_case_524 - case 525: - goto st_case_525 - case 526: - goto st_case_526 - case 527: - goto st_case_527 - case 528: - goto st_case_528 - case 529: - goto st_case_529 - case 530: - goto st_case_530 - case 531: - goto st_case_531 - case 532: - goto st_case_532 - case 533: - goto st_case_533 - case 534: - goto st_case_534 - case 535: - goto st_case_535 - case 536: - goto st_case_536 - case 537: - goto st_case_537 - case 538: - goto st_case_538 - case 539: - goto st_case_539 - case 540: - goto st_case_540 - case 541: - goto st_case_541 - case 542: - goto st_case_542 - case 543: - goto st_case_543 - case 544: - goto st_case_544 - case 545: - goto st_case_545 - case 546: - goto st_case_546 - case 547: - goto st_case_547 - case 548: - goto st_case_548 - case 549: - goto st_case_549 - case 550: - goto st_case_550 - case 551: - goto st_case_551 - case 552: - goto st_case_552 - case 553: - goto st_case_553 - case 554: - goto st_case_554 - case 555: - goto st_case_555 - case 556: - goto st_case_556 - case 557: - goto st_case_557 - case 558: - goto st_case_558 - case 559: - goto st_case_559 - case 560: - goto st_case_560 - case 561: - goto st_case_561 - case 562: - goto st_case_562 - case 563: - goto st_case_563 - case 564: - goto st_case_564 - case 565: - goto st_case_565 - case 566: - goto st_case_566 - case 567: - goto st_case_567 - case 568: - goto st_case_568 - case 569: - goto st_case_569 - case 570: - goto st_case_570 - case 571: - goto st_case_571 - case 572: - goto st_case_572 - case 573: - goto st_case_573 - case 574: - goto st_case_574 - case 575: - goto st_case_575 - case 576: - goto st_case_576 - case 577: - goto st_case_577 - case 578: - goto st_case_578 - case 579: - goto st_case_579 - case 580: - goto st_case_580 - case 581: - goto st_case_581 - case 582: - goto st_case_582 - case 583: - goto st_case_583 - case 584: - goto st_case_584 - case 585: - goto st_case_585 - case 586: - goto st_case_586 - case 587: - goto st_case_587 - case 588: - goto st_case_588 + case 19: + goto st_case_19 + case 20: + goto st_case_20 + case 21: + goto st_case_21 + case 22: + goto st_case_22 } goto st_out st_case_1: @@ -1249,86 +126,13 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr0: -//line parser/common.rl:36 - - err = ErrPriority - p-- - - goto st0 - tr6: -//line parser/rfc5424.rl:53 - - err = ErrVersion - p-- - - goto st0 - tr11: -//line parser/common.rl:41 +//line parser/common.rl:42 - err = ErrTimestamp + errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) p-- goto st0 - tr15: -//line parser/common.rl:46 - - err = ErrHostname - p-- - - goto st0 - tr19: -//line parser/rfc5424.rl:58 - - err = ErrAppName - p-- - - goto st0 - tr23: -//line parser/rfc5424.rl:63 - - err = ErrProcID - p-- - - goto st0 - tr27: -//line parser/rfc5424.rl:68 - - err = ErrMsgID - p-- - - goto st0 - tr31: -//line parser/rfc5424.rl:73 - - err = ErrStructuredData - p-- - - goto st0 - tr34: -//line parser/rfc5424.rl:78 - - err = ErrSDID - p-- - -//line parser/rfc5424.rl:73 - - err = ErrStructuredData - p-- - - goto st0 - tr78: -//line parser/rfc5424.rl:83 - - err = ErrSDParam - p-- - -//line parser/rfc5424.rl:73 - - err = ErrStructuredData - p-- - - goto st0 -//line rfc5424_gen.go:1332 +//line rfc5424_gen.go:125 st_case_0: st0: cs = 0 @@ -1338,14 +142,8 @@ func parseRFC5424(data string) (message, error) { goto _test_eof2 } st_case_2: - switch data[p] { - case 48: + if 33 <= data[p] && data[p] <= 126 { goto tr2 - case 49: - goto tr3 - } - if 50 <= data[p] && data[p] <= 57 { - goto tr4 } goto tr0 tr2: @@ -1359,15 +157,20 @@ func parseRFC5424(data string) (message, error) { goto _test_eof3 } st_case_3: -//line rfc5424_gen.go:1363 +//line rfc5424_gen.go:150 if data[p] == 62 { - goto tr5 + goto tr4 + } + if 33 <= data[p] && data[p] <= 126 { + goto st3 } goto tr0 - tr5: + tr4: //line parser/common.rl:8 - m.setPriority(data[tok:p]) + if err := m.setPriority(data[tok:p]); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + } goto st4 st4: @@ -1375,12 +178,15 @@ func parseRFC5424(data string) (message, error) { goto _test_eof4 } st_case_4: -//line rfc5424_gen.go:1379 - if 49 <= data[p] && data[p] <= 57 { - goto tr7 +//line rfc5424_gen.go:171 + if data[p] == 62 { + goto tr6 } - goto tr6 - tr7: + if 33 <= data[p] && data[p] <= 126 { + goto tr5 + } + goto tr0 + tr5: //line parser/common.rl:4 tok = p @@ -1391,18 +197,23 @@ func parseRFC5424(data string) (message, error) { goto _test_eof5 } st_case_5: -//line rfc5424_gen.go:1395 - if data[p] == 32 { - goto tr8 +//line rfc5424_gen.go:190 + switch data[p] { + case 32: + goto tr7 + case 62: + goto tr9 } - if 48 <= data[p] && data[p] <= 57 { - goto st584 + if 33 <= data[p] && data[p] <= 126 { + goto st5 } - goto st0 - tr8: + goto tr0 + tr7: //line parser/rfc5424.rl:19 - m.setVersion(data[tok:p]) + if err := m.setVersion(data[tok:p]); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + } goto st6 st6: @@ -1410,14 +221,14 @@ func parseRFC5424(data string) (message, error) { goto _test_eof6 } st_case_6: -//line rfc5424_gen.go:1414 +//line rfc5424_gen.go:214 if data[p] == 45 { goto st7 } if 48 <= data[p] && data[p] <= 57 { - goto tr13 + goto tr11 } - goto tr11 + goto tr0 st7: if p++; p == pe { goto _test_eof7 @@ -1426,11 +237,13 @@ func parseRFC5424(data string) (message, error) { if data[p] == 32 { goto st8 } - goto st0 - tr596: -//line parser/common.rl:12 + goto tr0 + tr31: +//line parser/common.rl:14 - m.setTimestampRFC3339(data[tok:p]) + if err := m.setTimestampRFC3339(data[tok:p]); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + } goto st8 st8: @@ -1438,12 +251,12 @@ func parseRFC5424(data string) (message, error) { goto _test_eof8 } st_case_8: -//line rfc5424_gen.go:1442 +//line rfc5424_gen.go:244 if 33 <= data[p] && data[p] <= 126 { - goto tr16 + goto tr13 } - goto tr15 - tr16: + goto tr0 + tr13: //line parser/common.rl:4 tok = p @@ -1454,16 +267,16 @@ func parseRFC5424(data string) (message, error) { goto _test_eof9 } st_case_9: -//line rfc5424_gen.go:1458 +//line rfc5424_gen.go:260 if data[p] == 32 { - goto tr17 + goto tr14 } if 33 <= data[p] && data[p] <= 126 { - goto st293 + goto st9 } - goto tr15 - tr17: -//line parser/common.rl:20 + goto tr0 + tr14: +//line parser/common.rl:26 m.setHostname(data[tok:p]) @@ -1473,12 +286,12 @@ func parseRFC5424(data string) (message, error) { goto _test_eof10 } st_case_10: -//line rfc5424_gen.go:1477 +//line rfc5424_gen.go:279 if 33 <= data[p] && data[p] <= 126 { - goto tr20 + goto tr16 } - goto tr19 - tr20: + goto tr0 + tr16: //line parser/common.rl:4 tok = p @@ -1489,15 +302,15 @@ func parseRFC5424(data string) (message, error) { goto _test_eof11 } st_case_11: -//line rfc5424_gen.go:1493 +//line rfc5424_gen.go:295 if data[p] == 32 { - goto tr21 + goto tr17 } if 33 <= data[p] && data[p] <= 126 { - goto st246 + goto st11 } - goto tr19 - tr21: + goto tr0 + tr17: //line parser/rfc5424.rl:11 m.setAppName(data[tok:p]) @@ -1508,12 +321,12 @@ func parseRFC5424(data string) (message, error) { goto _test_eof12 } st_case_12: -//line rfc5424_gen.go:1512 +//line rfc5424_gen.go:314 if 33 <= data[p] && data[p] <= 126 { - goto tr24 + goto tr19 } - goto tr23 - tr24: + goto tr0 + tr19: //line parser/common.rl:4 tok = p @@ -1524,15 +337,15 @@ func parseRFC5424(data string) (message, error) { goto _test_eof13 } st_case_13: -//line rfc5424_gen.go:1528 +//line rfc5424_gen.go:330 if data[p] == 32 { - goto tr25 + goto tr20 } if 33 <= data[p] && data[p] <= 126 { - goto st119 + goto st13 } - goto tr23 - tr25: + goto tr0 + tr20: //line parser/rfc5424.rl:7 m.setProcID(data[tok:p]) @@ -1543,12 +356,12 @@ func parseRFC5424(data string) (message, error) { goto _test_eof14 } st_case_14: -//line rfc5424_gen.go:1547 +//line rfc5424_gen.go:349 if 33 <= data[p] && data[p] <= 126 { - goto tr28 + goto tr22 } - goto tr27 - tr28: + goto tr0 + tr22: //line parser/common.rl:4 tok = p @@ -1559,15 +372,15 @@ func parseRFC5424(data string) (message, error) { goto _test_eof15 } st_case_15: -//line rfc5424_gen.go:1563 +//line rfc5424_gen.go:365 if data[p] == 32 { - goto tr29 + goto tr23 } if 33 <= data[p] && data[p] <= 126 { - goto st88 + goto st15 } - goto tr27 - tr29: + goto tr0 + tr23: //line parser/rfc5424.rl:15 m.setMsgID(data[tok:p]) @@ -1578,46 +391,46 @@ func parseRFC5424(data string) (message, error) { goto _test_eof16 } st_case_16: -//line rfc5424_gen.go:1582 +//line rfc5424_gen.go:384 switch data[p] { case 45: - goto st589 + goto st23 case 91: - goto tr33 + goto tr26 } - goto tr31 - st589: + goto tr0 + st23: if p++; p == pe { - goto _test_eof589 + goto _test_eof23 } - st_case_589: + st_case_23: if data[p] == 32 { - goto st590 + goto st24 } - goto st0 - st590: + goto tr0 + st24: if p++; p == pe { - goto _test_eof590 + goto _test_eof24 } - st_case_590: - goto tr608 - tr608: + st_case_24: + goto tr34 + tr34: //line parser/common.rl:4 tok = p - goto st591 - st591: + goto st25 + st25: if p++; p == pe { - goto _test_eof591 + goto _test_eof25 } - st_case_591: -//line rfc5424_gen.go:1616 - goto st591 - tr33: -//line parser/rfc5424.rl:23 + st_case_25: +//line rfc5424_gen.go:418 + goto st25 + tr26: +//line parser/common.rl:4 - m.structuredData = map[string]map[string]string{} + tok = p goto st17 st17: @@ -1625,63 +438,84 @@ func parseRFC5424(data string) (message, error) { goto _test_eof17 } st_case_17: -//line rfc5424_gen.go:1629 - if data[p] == 33 { - goto tr35 - } - switch { - case data[p] < 62: - if 35 <= data[p] && data[p] <= 60 { - goto tr35 - } - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto tr35 - } - default: - goto tr35 - } - goto tr34 - tr35: -//line parser/common.rl:4 - - tok = p - +//line rfc5424_gen.go:431 goto st18 st18: if p++; p == pe { goto _test_eof18 } st_case_18: -//line rfc5424_gen.go:1657 + if data[p] == 93 { + goto st26 + } + goto st18 + st26: + if p++; p == pe { + goto _test_eof26 + } + st_case_26: switch data[p] { case 32: goto tr36 - case 33: - goto st57 case 93: + goto st26 + } + goto st18 + tr36: +//line parser/rfc5424.rl:25 + + m.setRawSDValue(data[tok:p]) + + goto st27 + st27: + if p++; p == pe { + goto _test_eof27 + } + st_case_27: +//line rfc5424_gen.go:465 + if data[p] == 93 { goto tr38 } - switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st57 - } - case data[p] >= 35: - goto st57 + goto tr37 + tr37: +//line parser/common.rl:4 + + tok = p + + goto st28 + st28: + if p++; p == pe { + goto _test_eof28 } - goto tr34 - tr36: -//line parser/rfc5424.rl:39 + st_case_28: +//line rfc5424_gen.go:481 + if data[p] == 93 { + goto st29 + } + goto st28 + tr38: +//line parser/common.rl:4 - s.sdID = data[tok:p] - if _, ok := m.structuredData[s.sdID]; ok { - err = ErrSDIDDuplicated - p-- + tok = p - } else { - m.structuredData[s.sdID] = map[string]string{} + goto st29 + st29: + if p++; p == pe { + goto _test_eof29 + } + st_case_29: +//line rfc5424_gen.go:497 + switch data[p] { + case 32: + goto tr36 + case 93: + goto st29 } + goto st28 + tr11: +//line parser/common.rl:4 + + tok = p goto st19 st19: @@ -1689,9541 +523,2148 @@ func parseRFC5424(data string) (message, error) { goto _test_eof19 } st_case_19: -//line rfc5424_gen.go:1693 - if data[p] == 33 { - goto tr39 +//line rfc5424_gen.go:516 + switch data[p] { + case 43: + goto st20 + case 58: + goto st20 } switch { - case data[p] < 62: - if 35 <= data[p] && data[p] <= 60 { - goto tr39 + case data[p] < 48: + if 45 <= data[p] && data[p] <= 46 { + goto st20 } - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto tr39 + case data[p] > 57: + switch { + case data[p] > 90: + if 97 <= data[p] && data[p] <= 122 { + goto st20 + } + case data[p] >= 65: + goto st20 } default: - goto tr39 + goto st21 } - goto tr31 - tr39: -//line parser/common.rl:4 - - tok = p - - goto st20 + goto tr0 st20: if p++; p == pe { goto _test_eof20 } st_case_20: -//line rfc5424_gen.go:1721 - switch data[p] { - case 33: - goto st21 - case 61: - goto tr41 + if data[p] == 32 { + goto tr31 } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st21 - } - case data[p] >= 35: - goto st21 + if 48 <= data[p] && data[p] <= 57 { + goto st19 } - goto tr31 + goto tr0 st21: if p++; p == pe { goto _test_eof21 } st_case_21: switch data[p] { - case 33: - goto st22 - case 61: - goto tr41 + case 32: + goto tr31 + case 43: + goto st20 + case 58: + goto st20 } switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st22 + case data[p] < 48: + if 45 <= data[p] && data[p] <= 46 { + goto st20 } - case data[p] >= 35: - goto st22 + case data[p] > 57: + switch { + case data[p] > 90: + if 97 <= data[p] && data[p] <= 122 { + goto st20 + } + case data[p] >= 65: + goto st20 + } + default: + goto st21 + } + goto tr0 + tr9: +//line parser/common.rl:8 + + if err := m.setPriority(data[tok:p]); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + } + + goto st22 + tr6: +//line parser/common.rl:8 + + if err := m.setPriority(data[tok:p]); err != nil { + errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) } - goto tr31 + +//line parser/common.rl:4 + + tok = p + + goto st22 st22: if p++; p == pe { goto _test_eof22 } st_case_22: +//line rfc5424_gen.go:609 switch data[p] { - case 33: - goto st23 - case 61: - goto tr41 - } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st23 - } - case data[p] >= 35: - goto st23 + case 32: + goto tr7 + case 62: + goto tr6 } - goto tr31 - st23: - if p++; p == pe { - goto _test_eof23 + if 33 <= data[p] && data[p] <= 126 { + goto tr5 } - st_case_23: - switch data[p] { - case 33: - goto st24 - case 61: - goto tr41 + goto tr0 + st_out: + _test_eof2: + cs = 2 + goto _test_eof + _test_eof3: + cs = 3 + goto _test_eof + _test_eof4: + cs = 4 + goto _test_eof + _test_eof5: + cs = 5 + goto _test_eof + _test_eof6: + cs = 6 + goto _test_eof + _test_eof7: + cs = 7 + goto _test_eof + _test_eof8: + cs = 8 + goto _test_eof + _test_eof9: + cs = 9 + goto _test_eof + _test_eof10: + cs = 10 + goto _test_eof + _test_eof11: + cs = 11 + goto _test_eof + _test_eof12: + cs = 12 + goto _test_eof + _test_eof13: + cs = 13 + goto _test_eof + _test_eof14: + cs = 14 + goto _test_eof + _test_eof15: + cs = 15 + goto _test_eof + _test_eof16: + cs = 16 + goto _test_eof + _test_eof23: + cs = 23 + goto _test_eof + _test_eof24: + cs = 24 + goto _test_eof + _test_eof25: + cs = 25 + goto _test_eof + _test_eof17: + cs = 17 + goto _test_eof + _test_eof18: + cs = 18 + goto _test_eof + _test_eof26: + cs = 26 + goto _test_eof + _test_eof27: + cs = 27 + goto _test_eof + _test_eof28: + cs = 28 + goto _test_eof + _test_eof29: + cs = 29 + goto _test_eof + _test_eof19: + cs = 19 + goto _test_eof + _test_eof20: + cs = 20 + goto _test_eof + _test_eof21: + cs = 21 + goto _test_eof + _test_eof22: + cs = 22 + goto _test_eof + + _test_eof: + { } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st24 - } - case data[p] >= 35: - goto st24 + if p == eof { + switch cs { + case 25, 28: +//line parser/common.rl:30 + + m.setMsg(data[tok:p]) + + case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22: +//line parser/common.rl:42 + + errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) + p-- + + case 26: +//line parser/rfc5424.rl:25 + + m.setRawSDValue(data[tok:p]) + + case 24, 27: +//line parser/common.rl:4 + + tok = p + +//line parser/common.rl:30 + + m.setMsg(data[tok:p]) + + case 29: +//line parser/rfc5424.rl:25 + + m.setRawSDValue(data[tok:p]) + +//line parser/common.rl:30 + + m.setMsg(data[tok:p]) + +//line rfc5424_gen.go:688 + } } - goto tr31 - st24: - if p++; p == pe { - goto _test_eof24 + + _out: + { } - st_case_24: - switch data[p] { - case 33: - goto st25 - case 61: - goto tr41 + } + +//line parser/parser_rfc5424.rl:37 + + return m, errs +} + +//line rfc5424_gen.go:702 +const check_start int = 1 +const check_first_final int = 10 +const check_error int = 0 + +const check_en_main int = 1 + +//line parser/parser_rfc5424.rl:46 + +// isRFC5424 returns true if data is formatted as an RFC 5424 syslog message. +func isRFC5424(data string) bool { + var isRFC5424 bool + var p, cs int + + pe := len(data) + +//line rfc5424_gen.go:721 + { + cs = check_start + } + +//line rfc5424_gen.go:726 + { + if p == pe { + goto _test_eof } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st25 - } - case data[p] >= 35: - goto st25 + switch cs { + case 1: + goto st_case_1 + case 0: + goto st_case_0 + case 2: + goto st_case_2 + case 3: + goto st_case_3 + case 4: + goto st_case_4 + case 5: + goto st_case_5 + case 6: + goto st_case_6 + case 7: + goto st_case_7 + case 8: + goto st_case_8 + case 9: + goto st_case_9 + case 10: + goto st_case_10 } - goto tr31 - st25: - if p++; p == pe { - goto _test_eof25 + goto st_out + st_case_1: + if data[p] == 60 { + goto st2 } - st_case_25: - switch data[p] { - case 33: - goto st26 - case 61: - goto tr41 + goto st0 + st_case_0: + st0: + cs = 0 + goto _out + st2: + if p++; p == pe { + goto _test_eof2 } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st26 - } - case data[p] >= 35: - goto st26 + st_case_2: + if 48 <= data[p] && data[p] <= 57 { + goto st3 } - goto tr31 - st26: + goto st0 + st3: if p++; p == pe { - goto _test_eof26 + goto _test_eof3 } - st_case_26: - switch data[p] { - case 33: - goto st27 - case 61: - goto tr41 + st_case_3: + if data[p] == 62 { + goto st4 } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st27 - } - case data[p] >= 35: - goto st27 + if 48 <= data[p] && data[p] <= 57 { + goto st3 } - goto tr31 - st27: + goto st0 + st4: if p++; p == pe { - goto _test_eof27 - } - st_case_27: - switch data[p] { - case 33: - goto st28 - case 61: - goto tr41 + goto _test_eof4 } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st28 - } - case data[p] >= 35: - goto st28 + st_case_4: + if 48 <= data[p] && data[p] <= 57 { + goto st5 } - goto tr31 - st28: + goto st0 + st5: if p++; p == pe { - goto _test_eof28 + goto _test_eof5 } - st_case_28: - switch data[p] { - case 33: - goto st29 - case 61: - goto tr41 + st_case_5: + if data[p] == 32 { + goto st6 } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st29 - } - case data[p] >= 35: - goto st29 + if 48 <= data[p] && data[p] <= 57 { + goto st5 } - goto tr31 - st29: + goto st0 + st6: if p++; p == pe { - goto _test_eof29 - } - st_case_29: - switch data[p] { - case 33: - goto st30 - case 61: - goto tr41 + goto _test_eof6 } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st30 - } - case data[p] >= 35: - goto st30 + st_case_6: + if 48 <= data[p] && data[p] <= 57 { + goto tr6 } - goto tr31 - st30: + goto st0 + tr6: +//line parser/parser_rfc5424.rl:56 + + isRFC5424 = true + + goto st7 + st7: if p++; p == pe { - goto _test_eof30 - } - st_case_30: - switch data[p] { - case 33: - goto st31 - case 61: - goto tr41 + goto _test_eof7 } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st31 - } - case data[p] >= 35: - goto st31 + st_case_7: +//line rfc5424_gen.go:827 + if 48 <= data[p] && data[p] <= 57 { + goto st8 } - goto tr31 - st31: + goto st0 + st8: if p++; p == pe { - goto _test_eof31 + goto _test_eof8 } - st_case_31: - switch data[p] { - case 33: - goto st32 - case 61: - goto tr41 + st_case_8: + if 48 <= data[p] && data[p] <= 57 { + goto st9 } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st32 - } - case data[p] >= 35: - goto st32 - } - goto tr31 - st32: + goto st0 + st9: if p++; p == pe { - goto _test_eof32 - } - st_case_32: - switch data[p] { - case 33: - goto st33 - case 61: - goto tr41 + goto _test_eof9 } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st33 - } - case data[p] >= 35: - goto st33 + st_case_9: + if 48 <= data[p] && data[p] <= 57 { + goto st10 } - goto tr31 - st33: + goto st0 + st10: if p++; p == pe { - goto _test_eof33 + goto _test_eof10 } - st_case_33: - switch data[p] { - case 33: - goto st34 - case 61: - goto tr41 + st_case_10: + goto st0 + st_out: + _test_eof2: + cs = 2 + goto _test_eof + _test_eof3: + cs = 3 + goto _test_eof + _test_eof4: + cs = 4 + goto _test_eof + _test_eof5: + cs = 5 + goto _test_eof + _test_eof6: + cs = 6 + goto _test_eof + _test_eof7: + cs = 7 + goto _test_eof + _test_eof8: + cs = 8 + goto _test_eof + _test_eof9: + cs = 9 + goto _test_eof + _test_eof10: + cs = 10 + goto _test_eof + + _test_eof: + { } - switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st34 - } - case data[p] >= 35: - goto st34 + _out: + { } - goto tr31 - st34: - if p++; p == pe { - goto _test_eof34 + } + +//line parser/parser_rfc5424.rl:67 + + return isRFC5424 +} + +//line rfc5424_gen.go:878 +const parse_sd_start int = 1 +const parse_sd_first_final int = 73 +const parse_sd_error int = 0 + +const parse_sd_en_main int = 1 + +//line parser/parser_rfc5424.rl:76 + +// structuredData performs a best effort parsing of the raw structured data value +// extracted from the syslog message. If the raw structured data value is an empty +// string or the nil value ('-'), nil is returned. Otherwise, the value is parsed +// using the format defined by RFC 5424. If the value cannot be parsed, then nil +// is returned. +func parseStructuredData(data string) map[string]interface{} { + var s machineState + var p, cs, tok int + + pe := len(data) + structuredData := map[string]interface{}{} + + if data == "" || data == "-" { + return nil + } + +//line rfc5424_gen.go:906 + { + cs = parse_sd_start + } + +//line rfc5424_gen.go:911 + { + if p == pe { + goto _test_eof } - st_case_34: - switch data[p] { + switch cs { + case 1: + goto st_case_1 + case 0: + goto st_case_0 + case 2: + goto st_case_2 + case 3: + goto st_case_3 + case 4: + goto st_case_4 + case 5: + goto st_case_5 + case 6: + goto st_case_6 + case 7: + goto st_case_7 + case 8: + goto st_case_8 + case 9: + goto st_case_9 + case 10: + goto st_case_10 + case 11: + goto st_case_11 + case 12: + goto st_case_12 + case 13: + goto st_case_13 + case 14: + goto st_case_14 + case 15: + goto st_case_15 + case 16: + goto st_case_16 + case 17: + goto st_case_17 + case 18: + goto st_case_18 + case 19: + goto st_case_19 + case 20: + goto st_case_20 + case 21: + goto st_case_21 + case 22: + goto st_case_22 + case 23: + goto st_case_23 + case 24: + goto st_case_24 + case 25: + goto st_case_25 + case 26: + goto st_case_26 + case 27: + goto st_case_27 + case 28: + goto st_case_28 + case 29: + goto st_case_29 + case 30: + goto st_case_30 + case 31: + goto st_case_31 + case 32: + goto st_case_32 case 33: - goto st35 + goto st_case_33 + case 34: + goto st_case_34 + case 35: + goto st_case_35 + case 36: + goto st_case_36 + case 37: + goto st_case_37 + case 38: + goto st_case_38 + case 39: + goto st_case_39 + case 40: + goto st_case_40 + case 73: + goto st_case_73 + case 41: + goto st_case_41 + case 42: + goto st_case_42 + case 43: + goto st_case_43 + case 44: + goto st_case_44 + case 45: + goto st_case_45 + case 46: + goto st_case_46 + case 47: + goto st_case_47 + case 48: + goto st_case_48 + case 49: + goto st_case_49 + case 50: + goto st_case_50 + case 51: + goto st_case_51 + case 52: + goto st_case_52 + case 53: + goto st_case_53 + case 54: + goto st_case_54 + case 55: + goto st_case_55 + case 56: + goto st_case_56 + case 57: + goto st_case_57 + case 58: + goto st_case_58 + case 59: + goto st_case_59 + case 60: + goto st_case_60 case 61: - goto tr41 + goto st_case_61 + case 62: + goto st_case_62 + case 63: + goto st_case_63 + case 64: + goto st_case_64 + case 65: + goto st_case_65 + case 66: + goto st_case_66 + case 67: + goto st_case_67 + case 68: + goto st_case_68 + case 69: + goto st_case_69 + case 70: + goto st_case_70 + case 71: + goto st_case_71 + case 72: + goto st_case_72 + } + goto st_out + st_case_1: + if data[p] == 91 { + goto st2 + } + goto st0 + st_case_0: + st0: + cs = 0 + goto _out + st2: + if p++; p == pe { + goto _test_eof2 + } + st_case_2: + if data[p] == 33 { + goto tr2 } switch { + case data[p] < 62: + if 35 <= data[p] && data[p] <= 60 { + goto tr2 + } case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st35 + goto tr2 } - case data[p] >= 35: - goto st35 + default: + goto tr2 } - goto tr31 - st35: + goto st0 + tr2: +//line parser/common.rl:4 + + tok = p + + goto st3 + st3: if p++; p == pe { - goto _test_eof35 + goto _test_eof3 } - st_case_35: + st_case_3: +//line rfc5424_gen.go:1108 switch data[p] { + case 32: + goto tr3 case 33: - goto st36 - case 61: - goto tr41 + goto st42 + case 93: + goto tr5 } switch { - case data[p] > 92: - if 94 <= data[p] && data[p] <= 126 { - goto st36 + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st42 } case data[p] >= 35: - goto st36 + goto st42 } - goto tr31 - st36: + goto st0 + tr3: +//line parser/rfc5424.rl:43 + + s.sdID = data[tok:p] + if _, ok := structuredData[s.sdID]; !ok { + structuredData[s.sdID] = map[string]interface{}{} + } + + goto st4 + st4: if p++; p == pe { - goto _test_eof36 + goto _test_eof4 } - st_case_36: - switch data[p] { - case 33: - goto st37 - case 61: - goto tr41 + st_case_4: +//line rfc5424_gen.go:1140 + if data[p] == 33 { + goto tr6 } switch { + case data[p] < 62: + if 35 <= data[p] && data[p] <= 60 { + goto tr6 + } case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st37 + goto tr6 } - case data[p] >= 35: - goto st37 + default: + goto tr6 } - goto tr31 - st37: + goto st0 + tr6: +//line parser/common.rl:4 + + tok = p + + goto st5 + st5: if p++; p == pe { - goto _test_eof37 + goto _test_eof5 } - st_case_37: + st_case_5: +//line rfc5424_gen.go:1168 switch data[p] { case 33: - goto st38 + goto st6 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st38 + goto st6 } case data[p] >= 35: - goto st38 + goto st6 } - goto tr31 - st38: + goto st0 + st6: if p++; p == pe { - goto _test_eof38 + goto _test_eof6 } - st_case_38: + st_case_6: switch data[p] { case 33: - goto st39 + goto st7 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st39 + goto st7 } case data[p] >= 35: - goto st39 + goto st7 } - goto tr31 - st39: + goto st0 + st7: if p++; p == pe { - goto _test_eof39 + goto _test_eof7 } - st_case_39: + st_case_7: switch data[p] { case 33: - goto st40 + goto st8 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st40 + goto st8 } case data[p] >= 35: - goto st40 + goto st8 } - goto tr31 - st40: + goto st0 + st8: if p++; p == pe { - goto _test_eof40 + goto _test_eof8 } - st_case_40: + st_case_8: switch data[p] { case 33: - goto st41 + goto st9 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st41 + goto st9 } case data[p] >= 35: - goto st41 + goto st9 } - goto tr31 - st41: + goto st0 + st9: if p++; p == pe { - goto _test_eof41 + goto _test_eof9 } - st_case_41: + st_case_9: switch data[p] { case 33: - goto st42 + goto st10 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st42 + goto st10 } case data[p] >= 35: - goto st42 + goto st10 } - goto tr31 - st42: + goto st0 + st10: if p++; p == pe { - goto _test_eof42 + goto _test_eof10 } - st_case_42: + st_case_10: switch data[p] { case 33: - goto st43 + goto st11 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st43 + goto st11 } case data[p] >= 35: - goto st43 + goto st11 } - goto tr31 - st43: + goto st0 + st11: if p++; p == pe { - goto _test_eof43 + goto _test_eof11 } - st_case_43: + st_case_11: switch data[p] { case 33: - goto st44 + goto st12 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st44 + goto st12 } case data[p] >= 35: - goto st44 + goto st12 } - goto tr31 - st44: + goto st0 + st12: if p++; p == pe { - goto _test_eof44 + goto _test_eof12 } - st_case_44: + st_case_12: switch data[p] { case 33: - goto st45 + goto st13 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st45 + goto st13 } case data[p] >= 35: - goto st45 + goto st13 } - goto tr31 - st45: + goto st0 + st13: if p++; p == pe { - goto _test_eof45 + goto _test_eof13 } - st_case_45: + st_case_13: switch data[p] { case 33: - goto st46 + goto st14 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st46 + goto st14 } case data[p] >= 35: - goto st46 + goto st14 } - goto tr31 - st46: + goto st0 + st14: if p++; p == pe { - goto _test_eof46 + goto _test_eof14 } - st_case_46: + st_case_14: switch data[p] { case 33: - goto st47 + goto st15 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st47 + goto st15 } case data[p] >= 35: - goto st47 + goto st15 } - goto tr31 - st47: + goto st0 + st15: if p++; p == pe { - goto _test_eof47 + goto _test_eof15 } - st_case_47: + st_case_15: switch data[p] { case 33: - goto st48 + goto st16 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st48 + goto st16 } case data[p] >= 35: - goto st48 + goto st16 } - goto tr31 - st48: + goto st0 + st16: if p++; p == pe { - goto _test_eof48 + goto _test_eof16 } - st_case_48: + st_case_16: switch data[p] { case 33: - goto st49 + goto st17 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st49 + goto st17 } case data[p] >= 35: - goto st49 + goto st17 } - goto tr31 - st49: + goto st0 + st17: if p++; p == pe { - goto _test_eof49 + goto _test_eof17 } - st_case_49: + st_case_17: switch data[p] { case 33: - goto st50 + goto st18 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st50 + goto st18 } case data[p] >= 35: - goto st50 + goto st18 } - goto tr31 - st50: + goto st0 + st18: if p++; p == pe { - goto _test_eof50 + goto _test_eof18 } - st_case_50: + st_case_18: switch data[p] { case 33: - goto st51 + goto st19 case 61: - goto tr41 + goto tr8 } switch { case data[p] > 92: if 94 <= data[p] && data[p] <= 126 { - goto st51 + goto st19 } case data[p] >= 35: - goto st51 - } - goto tr31 - st51: - if p++; p == pe { - goto _test_eof51 - } - st_case_51: - if data[p] == 61 { - goto tr41 - } - goto tr31 - tr41: -//line parser/rfc5424.rl:31 - - s.sdParamName = data[tok:p] - - goto st52 - st52: - if p++; p == pe { - goto _test_eof52 - } - st_case_52: -//line rfc5424_gen.go:2357 - if data[p] == 34 { - goto st53 + goto st19 } - goto tr31 - st53: + goto st0 + st19: if p++; p == pe { - goto _test_eof53 + goto _test_eof19 } - st_case_53: + st_case_19: switch data[p] { - case 34: - goto tr31 - case 92: - goto tr74 - case 93: - goto tr31 - } - goto tr73 - tr73: -//line parser/common.rl:4 - - tok = p - - goto st54 - st54: - if p++; p == pe { - goto _test_eof54 + case 33: + goto st20 + case 61: + goto tr8 } - st_case_54: -//line rfc5424_gen.go:2387 - switch data[p] { - case 34: - goto tr76 - case 92: - goto tr77 - case 93: - goto tr78 + switch { + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st20 + } + case data[p] >= 35: + goto st20 } - goto st54 - tr76: -//line parser/rfc5424.rl:35 - - m.setDataValue(s.sdID, s.sdParamName, removeBytes(data[tok:p], s.sdValueEscapes, p)) - -//line parser/rfc5424.rl:27 - - s.sdValueEscapes = nil - - goto st55 - st55: + goto st0 + st20: if p++; p == pe { - goto _test_eof55 + goto _test_eof20 } - st_case_55: -//line rfc5424_gen.go:2412 + st_case_20: switch data[p] { - case 32: - goto st19 - case 93: - goto st592 + case 33: + goto st21 + case 61: + goto tr8 } - goto tr78 - tr38: -//line parser/rfc5424.rl:39 - - s.sdID = data[tok:p] - if _, ok := m.structuredData[s.sdID]; ok { - err = ErrSDIDDuplicated - p-- - - } else { - m.structuredData[s.sdID] = map[string]string{} + switch { + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st21 + } + case data[p] >= 35: + goto st21 } - - goto st592 - st592: + goto st0 + st21: if p++; p == pe { - goto _test_eof592 + goto _test_eof21 } - st_case_592: -//line rfc5424_gen.go:2438 + st_case_21: switch data[p] { - case 32: - goto st590 - case 91: - goto st17 - } - goto tr31 - tr74: -//line parser/common.rl:4 - - tok = p - -//line parser/rfc5424.rl:49 - - s.sdValueEscapes = append(s.sdValueEscapes, p) - - goto st56 - tr77: -//line parser/rfc5424.rl:49 - - s.sdValueEscapes = append(s.sdValueEscapes, p) - - goto st56 - st56: - if p++; p == pe { - goto _test_eof56 - } - st_case_56: -//line rfc5424_gen.go:2467 - if data[p] == 34 { - goto st54 + case 33: + goto st22 + case 61: + goto tr8 } - if 92 <= data[p] && data[p] <= 93 { - goto st54 + switch { + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st22 + } + case data[p] >= 35: + goto st22 } - goto tr31 - st57: + goto st0 + st22: if p++; p == pe { - goto _test_eof57 + goto _test_eof22 } - st_case_57: + st_case_22: switch data[p] { - case 32: - goto tr36 case 33: - goto st58 - case 93: - goto tr38 + goto st23 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st58 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st23 } case data[p] >= 35: - goto st58 + goto st23 } - goto tr34 - st58: + goto st0 + st23: if p++; p == pe { - goto _test_eof58 + goto _test_eof23 } - st_case_58: + st_case_23: switch data[p] { - case 32: - goto tr36 case 33: - goto st59 - case 93: - goto tr38 + goto st24 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st59 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st24 } case data[p] >= 35: - goto st59 + goto st24 } - goto tr34 - st59: + goto st0 + st24: if p++; p == pe { - goto _test_eof59 + goto _test_eof24 } - st_case_59: + st_case_24: switch data[p] { - case 32: - goto tr36 case 33: - goto st60 - case 93: - goto tr38 + goto st25 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st60 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st25 } case data[p] >= 35: - goto st60 + goto st25 } - goto tr34 - st60: + goto st0 + st25: if p++; p == pe { - goto _test_eof60 + goto _test_eof25 } - st_case_60: + st_case_25: switch data[p] { - case 32: - goto tr36 case 33: - goto st61 - case 93: - goto tr38 + goto st26 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st61 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st26 } case data[p] >= 35: - goto st61 + goto st26 } - goto tr34 - st61: + goto st0 + st26: if p++; p == pe { - goto _test_eof61 + goto _test_eof26 } - st_case_61: + st_case_26: switch data[p] { - case 32: - goto tr36 case 33: - goto st62 - case 93: - goto tr38 + goto st27 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st62 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st27 } case data[p] >= 35: - goto st62 + goto st27 } - goto tr34 - st62: + goto st0 + st27: if p++; p == pe { - goto _test_eof62 + goto _test_eof27 } - st_case_62: + st_case_27: switch data[p] { - case 32: - goto tr36 case 33: - goto st63 - case 93: - goto tr38 + goto st28 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st63 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st28 } case data[p] >= 35: - goto st63 + goto st28 } - goto tr34 - st63: + goto st0 + st28: if p++; p == pe { - goto _test_eof63 + goto _test_eof28 } - st_case_63: + st_case_28: switch data[p] { - case 32: - goto tr36 case 33: - goto st64 - case 93: - goto tr38 + goto st29 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st64 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st29 } case data[p] >= 35: - goto st64 + goto st29 } - goto tr34 - st64: + goto st0 + st29: if p++; p == pe { - goto _test_eof64 + goto _test_eof29 } - st_case_64: + st_case_29: switch data[p] { - case 32: - goto tr36 case 33: - goto st65 - case 93: - goto tr38 + goto st30 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st65 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st30 } case data[p] >= 35: - goto st65 + goto st30 } - goto tr34 - st65: + goto st0 + st30: if p++; p == pe { - goto _test_eof65 + goto _test_eof30 } - st_case_65: + st_case_30: switch data[p] { - case 32: - goto tr36 case 33: - goto st66 - case 93: - goto tr38 + goto st31 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st66 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st31 } case data[p] >= 35: - goto st66 + goto st31 } - goto tr34 - st66: + goto st0 + st31: if p++; p == pe { - goto _test_eof66 + goto _test_eof31 } - st_case_66: + st_case_31: switch data[p] { - case 32: - goto tr36 case 33: - goto st67 - case 93: - goto tr38 + goto st32 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st67 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st32 } case data[p] >= 35: - goto st67 + goto st32 } - goto tr34 - st67: + goto st0 + st32: if p++; p == pe { - goto _test_eof67 + goto _test_eof32 } - st_case_67: + st_case_32: switch data[p] { - case 32: - goto tr36 case 33: - goto st68 - case 93: - goto tr38 + goto st33 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st68 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st33 } case data[p] >= 35: - goto st68 + goto st33 } - goto tr34 - st68: + goto st0 + st33: if p++; p == pe { - goto _test_eof68 + goto _test_eof33 } - st_case_68: + st_case_33: switch data[p] { - case 32: - goto tr36 case 33: - goto st69 - case 93: - goto tr38 + goto st34 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st69 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st34 } case data[p] >= 35: - goto st69 + goto st34 } - goto tr34 - st69: + goto st0 + st34: if p++; p == pe { - goto _test_eof69 + goto _test_eof34 } - st_case_69: + st_case_34: switch data[p] { - case 32: - goto tr36 case 33: - goto st70 - case 93: - goto tr38 + goto st35 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st70 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st35 } case data[p] >= 35: - goto st70 + goto st35 } - goto tr34 - st70: + goto st0 + st35: if p++; p == pe { - goto _test_eof70 + goto _test_eof35 } - st_case_70: + st_case_35: switch data[p] { - case 32: - goto tr36 case 33: - goto st71 - case 93: - goto tr38 + goto st36 + case 61: + goto tr8 } switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st71 + case data[p] > 92: + if 94 <= data[p] && data[p] <= 126 { + goto st36 } case data[p] >= 35: - goto st71 + goto st36 } - goto tr34 - st71: + goto st0 + st36: if p++; p == pe { - goto _test_eof71 + goto _test_eof36 } - st_case_71: - switch data[p] { - case 32: - goto tr36 - case 33: - goto st72 - case 93: - goto tr38 + st_case_36: + if data[p] == 61 { + goto tr8 } - switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st72 - } - case data[p] >= 35: - goto st72 + goto st0 + tr8: +//line parser/rfc5424.rl:33 + + s.sdParamName = data[tok:p] + + goto st37 + st37: + if p++; p == pe { + goto _test_eof37 } - goto tr34 - st72: + st_case_37: +//line rfc5424_gen.go:1804 + if data[p] == 34 { + goto st38 + } + goto st0 + st38: if p++; p == pe { - goto _test_eof72 + goto _test_eof38 } - st_case_72: + st_case_38: switch data[p] { - case 32: - goto tr36 - case 33: - goto st73 + case 34: + goto st0 + case 92: + goto tr41 case 93: - goto tr38 + goto st0 } - switch { - case data[p] > 60: - if 62 <= data[p] && data[p] <= 126 { - goto st73 - } - case data[p] >= 35: + goto tr40 + tr40: +//line parser/common.rl:4 + + tok = p + + goto st39 + st39: + if p++; p == pe { + goto _test_eof39 + } + st_case_39: +//line rfc5424_gen.go:1834 + switch data[p] { + case 34: + goto tr43 + case 92: + goto tr44 + case 93: + goto st0 + } + goto st39 + tr43: +//line parser/rfc5424.rl:37 + + if subMap, ok := structuredData[s.sdID].(map[string]interface{}); ok { + subMap[s.sdParamName] = removeBytes(data[tok:p], s.sdValueEscapes, p) + } + +//line parser/rfc5424.rl:29 + + s.sdValueEscapes = nil + + goto st40 + st40: + if p++; p == pe { + goto _test_eof40 + } + st_case_40: +//line rfc5424_gen.go:1861 + switch data[p] { + case 32: + goto st4 + case 93: goto st73 } - goto tr34 + goto st0 + tr5: +//line parser/rfc5424.rl:43 + + s.sdID = data[tok:p] + if _, ok := structuredData[s.sdID]; !ok { + structuredData[s.sdID] = map[string]interface{}{} + } + + goto st73 st73: if p++; p == pe { goto _test_eof73 } st_case_73: +//line rfc5424_gen.go:1883 + if data[p] == 91 { + goto st2 + } + goto st0 + tr41: +//line parser/common.rl:4 + + tok = p + +//line parser/rfc5424.rl:50 + + s.sdValueEscapes = append(s.sdValueEscapes, p) + + goto st41 + tr44: +//line parser/rfc5424.rl:50 + + s.sdValueEscapes = append(s.sdValueEscapes, p) + + goto st41 + st41: + if p++; p == pe { + goto _test_eof41 + } + st_case_41: +//line rfc5424_gen.go:1909 + if data[p] == 34 { + goto st39 + } + if 92 <= data[p] && data[p] <= 93 { + goto st39 + } + goto st0 + st42: + if p++; p == pe { + goto _test_eof42 + } + st_case_42: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st74 + goto st43 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st74 + goto st43 } case data[p] >= 35: - goto st74 + goto st43 } - goto tr34 - st74: + goto st0 + st43: if p++; p == pe { - goto _test_eof74 + goto _test_eof43 } - st_case_74: + st_case_43: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st75 + goto st44 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st75 + goto st44 } case data[p] >= 35: - goto st75 + goto st44 } - goto tr34 - st75: + goto st0 + st44: if p++; p == pe { - goto _test_eof75 + goto _test_eof44 } - st_case_75: + st_case_44: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st76 + goto st45 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st76 + goto st45 } case data[p] >= 35: - goto st76 + goto st45 } - goto tr34 - st76: + goto st0 + st45: if p++; p == pe { - goto _test_eof76 + goto _test_eof45 } - st_case_76: + st_case_45: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st77 + goto st46 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st77 + goto st46 } case data[p] >= 35: - goto st77 + goto st46 } - goto tr34 - st77: + goto st0 + st46: if p++; p == pe { - goto _test_eof77 + goto _test_eof46 } - st_case_77: + st_case_46: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st78 + goto st47 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st78 + goto st47 } case data[p] >= 35: - goto st78 + goto st47 } - goto tr34 - st78: + goto st0 + st47: if p++; p == pe { - goto _test_eof78 + goto _test_eof47 } - st_case_78: + st_case_47: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st79 + goto st48 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st79 + goto st48 } case data[p] >= 35: - goto st79 + goto st48 } - goto tr34 - st79: + goto st0 + st48: if p++; p == pe { - goto _test_eof79 + goto _test_eof48 } - st_case_79: + st_case_48: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st80 + goto st49 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st80 + goto st49 } case data[p] >= 35: - goto st80 + goto st49 } - goto tr34 - st80: + goto st0 + st49: if p++; p == pe { - goto _test_eof80 + goto _test_eof49 } - st_case_80: + st_case_49: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st81 + goto st50 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st81 + goto st50 } case data[p] >= 35: - goto st81 + goto st50 } - goto tr34 - st81: + goto st0 + st50: if p++; p == pe { - goto _test_eof81 + goto _test_eof50 } - st_case_81: + st_case_50: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st82 + goto st51 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st82 + goto st51 } case data[p] >= 35: - goto st82 + goto st51 } - goto tr34 - st82: + goto st0 + st51: if p++; p == pe { - goto _test_eof82 + goto _test_eof51 } - st_case_82: + st_case_51: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st83 + goto st52 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st83 + goto st52 } case data[p] >= 35: - goto st83 + goto st52 } - goto tr34 - st83: + goto st0 + st52: if p++; p == pe { - goto _test_eof83 + goto _test_eof52 } - st_case_83: + st_case_52: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st84 + goto st53 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st84 + goto st53 } case data[p] >= 35: - goto st84 + goto st53 } - goto tr34 - st84: + goto st0 + st53: if p++; p == pe { - goto _test_eof84 + goto _test_eof53 } - st_case_84: + st_case_53: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st85 + goto st54 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st85 + goto st54 } case data[p] >= 35: - goto st85 + goto st54 } - goto tr34 - st85: + goto st0 + st54: if p++; p == pe { - goto _test_eof85 + goto _test_eof54 } - st_case_85: + st_case_54: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st86 + goto st55 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st86 + goto st55 } case data[p] >= 35: - goto st86 + goto st55 } - goto tr34 - st86: + goto st0 + st55: if p++; p == pe { - goto _test_eof86 + goto _test_eof55 } - st_case_86: + st_case_55: switch data[p] { case 32: - goto tr36 + goto tr3 case 33: - goto st87 + goto st56 case 93: - goto tr38 + goto tr5 } switch { case data[p] > 60: if 62 <= data[p] && data[p] <= 126 { - goto st87 + goto st56 } case data[p] >= 35: - goto st87 + goto st56 } - goto tr34 - st87: + goto st0 + st56: if p++; p == pe { - goto _test_eof87 + goto _test_eof56 } - st_case_87: + st_case_56: switch data[p] { case 32: - goto tr36 + goto tr3 + case 33: + goto st57 case 93: - goto tr38 + goto tr5 } - goto tr34 - st88: + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st57 + } + case data[p] >= 35: + goto st57 + } + goto st0 + st57: if p++; p == pe { - goto _test_eof88 + goto _test_eof57 } - st_case_88: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st89 - } - goto tr27 - st89: - if p++; p == pe { - goto _test_eof89 - } - st_case_89: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st90 - } - goto tr27 - st90: - if p++; p == pe { - goto _test_eof90 - } - st_case_90: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st91 - } - goto tr27 - st91: - if p++; p == pe { - goto _test_eof91 - } - st_case_91: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st92 - } - goto tr27 - st92: - if p++; p == pe { - goto _test_eof92 - } - st_case_92: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st93 - } - goto tr27 - st93: - if p++; p == pe { - goto _test_eof93 - } - st_case_93: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st94 - } - goto tr27 - st94: - if p++; p == pe { - goto _test_eof94 - } - st_case_94: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st95 - } - goto tr27 - st95: - if p++; p == pe { - goto _test_eof95 - } - st_case_95: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st96 - } - goto tr27 - st96: - if p++; p == pe { - goto _test_eof96 - } - st_case_96: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st97 - } - goto tr27 - st97: - if p++; p == pe { - goto _test_eof97 - } - st_case_97: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st98 - } - goto tr27 - st98: - if p++; p == pe { - goto _test_eof98 - } - st_case_98: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st99 - } - goto tr27 - st99: - if p++; p == pe { - goto _test_eof99 - } - st_case_99: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st100 - } - goto tr27 - st100: - if p++; p == pe { - goto _test_eof100 - } - st_case_100: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st101 - } - goto tr27 - st101: - if p++; p == pe { - goto _test_eof101 - } - st_case_101: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st102 - } - goto tr27 - st102: - if p++; p == pe { - goto _test_eof102 - } - st_case_102: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st103 - } - goto tr27 - st103: - if p++; p == pe { - goto _test_eof103 - } - st_case_103: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st104 - } - goto tr27 - st104: - if p++; p == pe { - goto _test_eof104 - } - st_case_104: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st105 - } - goto tr27 - st105: - if p++; p == pe { - goto _test_eof105 - } - st_case_105: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st106 - } - goto tr27 - st106: - if p++; p == pe { - goto _test_eof106 - } - st_case_106: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st107 - } - goto tr27 - st107: - if p++; p == pe { - goto _test_eof107 - } - st_case_107: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st108 - } - goto tr27 - st108: - if p++; p == pe { - goto _test_eof108 - } - st_case_108: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st109 - } - goto tr27 - st109: - if p++; p == pe { - goto _test_eof109 - } - st_case_109: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st110 - } - goto tr27 - st110: - if p++; p == pe { - goto _test_eof110 - } - st_case_110: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st111 - } - goto tr27 - st111: - if p++; p == pe { - goto _test_eof111 - } - st_case_111: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st112 - } - goto tr27 - st112: - if p++; p == pe { - goto _test_eof112 - } - st_case_112: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st113 - } - goto tr27 - st113: - if p++; p == pe { - goto _test_eof113 - } - st_case_113: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st114 - } - goto tr27 - st114: - if p++; p == pe { - goto _test_eof114 - } - st_case_114: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st115 - } - goto tr27 - st115: - if p++; p == pe { - goto _test_eof115 - } - st_case_115: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st116 - } - goto tr27 - st116: - if p++; p == pe { - goto _test_eof116 - } - st_case_116: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st117 - } - goto tr27 - st117: - if p++; p == pe { - goto _test_eof117 - } - st_case_117: - if data[p] == 32 { - goto tr29 - } - if 33 <= data[p] && data[p] <= 126 { - goto st118 - } - goto tr27 - st118: - if p++; p == pe { - goto _test_eof118 - } - st_case_118: - if data[p] == 32 { - goto tr29 - } - goto tr27 - st119: - if p++; p == pe { - goto _test_eof119 - } - st_case_119: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st120 - } - goto tr23 - st120: - if p++; p == pe { - goto _test_eof120 - } - st_case_120: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st121 - } - goto tr23 - st121: - if p++; p == pe { - goto _test_eof121 - } - st_case_121: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st122 - } - goto tr23 - st122: - if p++; p == pe { - goto _test_eof122 - } - st_case_122: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st123 - } - goto tr23 - st123: - if p++; p == pe { - goto _test_eof123 - } - st_case_123: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st124 - } - goto tr23 - st124: - if p++; p == pe { - goto _test_eof124 - } - st_case_124: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st125 - } - goto tr23 - st125: - if p++; p == pe { - goto _test_eof125 - } - st_case_125: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st126 - } - goto tr23 - st126: - if p++; p == pe { - goto _test_eof126 - } - st_case_126: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st127 - } - goto tr23 - st127: - if p++; p == pe { - goto _test_eof127 - } - st_case_127: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st128 - } - goto tr23 - st128: - if p++; p == pe { - goto _test_eof128 - } - st_case_128: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st129 - } - goto tr23 - st129: - if p++; p == pe { - goto _test_eof129 - } - st_case_129: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st130 - } - goto tr23 - st130: - if p++; p == pe { - goto _test_eof130 - } - st_case_130: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st131 - } - goto tr23 - st131: - if p++; p == pe { - goto _test_eof131 - } - st_case_131: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st132 - } - goto tr23 - st132: - if p++; p == pe { - goto _test_eof132 - } - st_case_132: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st133 - } - goto tr23 - st133: - if p++; p == pe { - goto _test_eof133 - } - st_case_133: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st134 - } - goto tr23 - st134: - if p++; p == pe { - goto _test_eof134 - } - st_case_134: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st135 - } - goto tr23 - st135: - if p++; p == pe { - goto _test_eof135 - } - st_case_135: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st136 - } - goto tr23 - st136: - if p++; p == pe { - goto _test_eof136 - } - st_case_136: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st137 - } - goto tr23 - st137: - if p++; p == pe { - goto _test_eof137 - } - st_case_137: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st138 - } - goto tr23 - st138: - if p++; p == pe { - goto _test_eof138 - } - st_case_138: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st139 - } - goto tr23 - st139: - if p++; p == pe { - goto _test_eof139 - } - st_case_139: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st140 - } - goto tr23 - st140: - if p++; p == pe { - goto _test_eof140 - } - st_case_140: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st141 - } - goto tr23 - st141: - if p++; p == pe { - goto _test_eof141 - } - st_case_141: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st142 - } - goto tr23 - st142: - if p++; p == pe { - goto _test_eof142 - } - st_case_142: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st143 - } - goto tr23 - st143: - if p++; p == pe { - goto _test_eof143 - } - st_case_143: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st144 - } - goto tr23 - st144: - if p++; p == pe { - goto _test_eof144 - } - st_case_144: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st145 - } - goto tr23 - st145: - if p++; p == pe { - goto _test_eof145 - } - st_case_145: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st146 - } - goto tr23 - st146: - if p++; p == pe { - goto _test_eof146 - } - st_case_146: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st147 - } - goto tr23 - st147: - if p++; p == pe { - goto _test_eof147 - } - st_case_147: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st148 - } - goto tr23 - st148: - if p++; p == pe { - goto _test_eof148 - } - st_case_148: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st149 - } - goto tr23 - st149: - if p++; p == pe { - goto _test_eof149 - } - st_case_149: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st150 - } - goto tr23 - st150: - if p++; p == pe { - goto _test_eof150 - } - st_case_150: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st151 - } - goto tr23 - st151: - if p++; p == pe { - goto _test_eof151 - } - st_case_151: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st152 - } - goto tr23 - st152: - if p++; p == pe { - goto _test_eof152 - } - st_case_152: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st153 - } - goto tr23 - st153: - if p++; p == pe { - goto _test_eof153 - } - st_case_153: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st154 - } - goto tr23 - st154: - if p++; p == pe { - goto _test_eof154 - } - st_case_154: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st155 - } - goto tr23 - st155: - if p++; p == pe { - goto _test_eof155 - } - st_case_155: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st156 - } - goto tr23 - st156: - if p++; p == pe { - goto _test_eof156 - } - st_case_156: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st157 - } - goto tr23 - st157: - if p++; p == pe { - goto _test_eof157 - } - st_case_157: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st158 - } - goto tr23 - st158: - if p++; p == pe { - goto _test_eof158 - } - st_case_158: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st159 - } - goto tr23 - st159: - if p++; p == pe { - goto _test_eof159 - } - st_case_159: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st160 - } - goto tr23 - st160: - if p++; p == pe { - goto _test_eof160 - } - st_case_160: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st161 - } - goto tr23 - st161: - if p++; p == pe { - goto _test_eof161 - } - st_case_161: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st162 - } - goto tr23 - st162: - if p++; p == pe { - goto _test_eof162 - } - st_case_162: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st163 - } - goto tr23 - st163: - if p++; p == pe { - goto _test_eof163 - } - st_case_163: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st164 - } - goto tr23 - st164: - if p++; p == pe { - goto _test_eof164 - } - st_case_164: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st165 - } - goto tr23 - st165: - if p++; p == pe { - goto _test_eof165 - } - st_case_165: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st166 - } - goto tr23 - st166: - if p++; p == pe { - goto _test_eof166 - } - st_case_166: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st167 - } - goto tr23 - st167: - if p++; p == pe { - goto _test_eof167 - } - st_case_167: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st168 - } - goto tr23 - st168: - if p++; p == pe { - goto _test_eof168 - } - st_case_168: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st169 - } - goto tr23 - st169: - if p++; p == pe { - goto _test_eof169 - } - st_case_169: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st170 - } - goto tr23 - st170: - if p++; p == pe { - goto _test_eof170 - } - st_case_170: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st171 - } - goto tr23 - st171: - if p++; p == pe { - goto _test_eof171 - } - st_case_171: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st172 - } - goto tr23 - st172: - if p++; p == pe { - goto _test_eof172 - } - st_case_172: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st173 - } - goto tr23 - st173: - if p++; p == pe { - goto _test_eof173 - } - st_case_173: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st174 - } - goto tr23 - st174: - if p++; p == pe { - goto _test_eof174 - } - st_case_174: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st175 - } - goto tr23 - st175: - if p++; p == pe { - goto _test_eof175 - } - st_case_175: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st176 - } - goto tr23 - st176: - if p++; p == pe { - goto _test_eof176 - } - st_case_176: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st177 - } - goto tr23 - st177: - if p++; p == pe { - goto _test_eof177 - } - st_case_177: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st178 - } - goto tr23 - st178: - if p++; p == pe { - goto _test_eof178 - } - st_case_178: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st179 - } - goto tr23 - st179: - if p++; p == pe { - goto _test_eof179 - } - st_case_179: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st180 - } - goto tr23 - st180: - if p++; p == pe { - goto _test_eof180 - } - st_case_180: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st181 - } - goto tr23 - st181: - if p++; p == pe { - goto _test_eof181 - } - st_case_181: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st182 - } - goto tr23 - st182: - if p++; p == pe { - goto _test_eof182 - } - st_case_182: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st183 - } - goto tr23 - st183: - if p++; p == pe { - goto _test_eof183 - } - st_case_183: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st184 - } - goto tr23 - st184: - if p++; p == pe { - goto _test_eof184 - } - st_case_184: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st185 - } - goto tr23 - st185: - if p++; p == pe { - goto _test_eof185 - } - st_case_185: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st186 - } - goto tr23 - st186: - if p++; p == pe { - goto _test_eof186 - } - st_case_186: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st187 - } - goto tr23 - st187: - if p++; p == pe { - goto _test_eof187 - } - st_case_187: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st188 - } - goto tr23 - st188: - if p++; p == pe { - goto _test_eof188 - } - st_case_188: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st189 - } - goto tr23 - st189: - if p++; p == pe { - goto _test_eof189 - } - st_case_189: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st190 - } - goto tr23 - st190: - if p++; p == pe { - goto _test_eof190 - } - st_case_190: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st191 - } - goto tr23 - st191: - if p++; p == pe { - goto _test_eof191 - } - st_case_191: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st192 - } - goto tr23 - st192: - if p++; p == pe { - goto _test_eof192 - } - st_case_192: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st193 - } - goto tr23 - st193: - if p++; p == pe { - goto _test_eof193 - } - st_case_193: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st194 - } - goto tr23 - st194: - if p++; p == pe { - goto _test_eof194 - } - st_case_194: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st195 - } - goto tr23 - st195: - if p++; p == pe { - goto _test_eof195 - } - st_case_195: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st196 - } - goto tr23 - st196: - if p++; p == pe { - goto _test_eof196 - } - st_case_196: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st197 - } - goto tr23 - st197: - if p++; p == pe { - goto _test_eof197 - } - st_case_197: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st198 - } - goto tr23 - st198: - if p++; p == pe { - goto _test_eof198 - } - st_case_198: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st199 - } - goto tr23 - st199: - if p++; p == pe { - goto _test_eof199 - } - st_case_199: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st200 - } - goto tr23 - st200: - if p++; p == pe { - goto _test_eof200 - } - st_case_200: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st201 - } - goto tr23 - st201: - if p++; p == pe { - goto _test_eof201 - } - st_case_201: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st202 - } - goto tr23 - st202: - if p++; p == pe { - goto _test_eof202 - } - st_case_202: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st203 - } - goto tr23 - st203: - if p++; p == pe { - goto _test_eof203 - } - st_case_203: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st204 - } - goto tr23 - st204: - if p++; p == pe { - goto _test_eof204 - } - st_case_204: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st205 - } - goto tr23 - st205: - if p++; p == pe { - goto _test_eof205 - } - st_case_205: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st206 - } - goto tr23 - st206: - if p++; p == pe { - goto _test_eof206 - } - st_case_206: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st207 - } - goto tr23 - st207: - if p++; p == pe { - goto _test_eof207 - } - st_case_207: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st208 - } - goto tr23 - st208: - if p++; p == pe { - goto _test_eof208 - } - st_case_208: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st209 - } - goto tr23 - st209: - if p++; p == pe { - goto _test_eof209 - } - st_case_209: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st210 - } - goto tr23 - st210: - if p++; p == pe { - goto _test_eof210 - } - st_case_210: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st211 - } - goto tr23 - st211: - if p++; p == pe { - goto _test_eof211 - } - st_case_211: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st212 - } - goto tr23 - st212: - if p++; p == pe { - goto _test_eof212 - } - st_case_212: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st213 - } - goto tr23 - st213: - if p++; p == pe { - goto _test_eof213 - } - st_case_213: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st214 - } - goto tr23 - st214: - if p++; p == pe { - goto _test_eof214 - } - st_case_214: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st215 - } - goto tr23 - st215: - if p++; p == pe { - goto _test_eof215 - } - st_case_215: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st216 - } - goto tr23 - st216: - if p++; p == pe { - goto _test_eof216 - } - st_case_216: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st217 - } - goto tr23 - st217: - if p++; p == pe { - goto _test_eof217 - } - st_case_217: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st218 - } - goto tr23 - st218: - if p++; p == pe { - goto _test_eof218 - } - st_case_218: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st219 - } - goto tr23 - st219: - if p++; p == pe { - goto _test_eof219 - } - st_case_219: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st220 - } - goto tr23 - st220: - if p++; p == pe { - goto _test_eof220 - } - st_case_220: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st221 - } - goto tr23 - st221: - if p++; p == pe { - goto _test_eof221 - } - st_case_221: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st222 - } - goto tr23 - st222: - if p++; p == pe { - goto _test_eof222 - } - st_case_222: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st223 - } - goto tr23 - st223: - if p++; p == pe { - goto _test_eof223 - } - st_case_223: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st224 - } - goto tr23 - st224: - if p++; p == pe { - goto _test_eof224 - } - st_case_224: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st225 - } - goto tr23 - st225: - if p++; p == pe { - goto _test_eof225 - } - st_case_225: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st226 - } - goto tr23 - st226: - if p++; p == pe { - goto _test_eof226 - } - st_case_226: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st227 - } - goto tr23 - st227: - if p++; p == pe { - goto _test_eof227 - } - st_case_227: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st228 - } - goto tr23 - st228: - if p++; p == pe { - goto _test_eof228 - } - st_case_228: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st229 - } - goto tr23 - st229: - if p++; p == pe { - goto _test_eof229 - } - st_case_229: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st230 - } - goto tr23 - st230: - if p++; p == pe { - goto _test_eof230 - } - st_case_230: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st231 - } - goto tr23 - st231: - if p++; p == pe { - goto _test_eof231 - } - st_case_231: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st232 - } - goto tr23 - st232: - if p++; p == pe { - goto _test_eof232 - } - st_case_232: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st233 - } - goto tr23 - st233: - if p++; p == pe { - goto _test_eof233 - } - st_case_233: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st234 - } - goto tr23 - st234: - if p++; p == pe { - goto _test_eof234 - } - st_case_234: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st235 - } - goto tr23 - st235: - if p++; p == pe { - goto _test_eof235 - } - st_case_235: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st236 - } - goto tr23 - st236: - if p++; p == pe { - goto _test_eof236 - } - st_case_236: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st237 - } - goto tr23 - st237: - if p++; p == pe { - goto _test_eof237 - } - st_case_237: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st238 - } - goto tr23 - st238: - if p++; p == pe { - goto _test_eof238 - } - st_case_238: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st239 - } - goto tr23 - st239: - if p++; p == pe { - goto _test_eof239 - } - st_case_239: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st240 - } - goto tr23 - st240: - if p++; p == pe { - goto _test_eof240 - } - st_case_240: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st241 - } - goto tr23 - st241: - if p++; p == pe { - goto _test_eof241 - } - st_case_241: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st242 - } - goto tr23 - st242: - if p++; p == pe { - goto _test_eof242 - } - st_case_242: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st243 - } - goto tr23 - st243: - if p++; p == pe { - goto _test_eof243 - } - st_case_243: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st244 - } - goto tr23 - st244: - if p++; p == pe { - goto _test_eof244 - } - st_case_244: - if data[p] == 32 { - goto tr25 - } - if 33 <= data[p] && data[p] <= 126 { - goto st245 - } - goto tr23 - st245: - if p++; p == pe { - goto _test_eof245 - } - st_case_245: - if data[p] == 32 { - goto tr25 - } - goto tr23 - st246: - if p++; p == pe { - goto _test_eof246 - } - st_case_246: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st247 - } - goto tr19 - st247: - if p++; p == pe { - goto _test_eof247 - } - st_case_247: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st248 - } - goto tr19 - st248: - if p++; p == pe { - goto _test_eof248 - } - st_case_248: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st249 - } - goto tr19 - st249: - if p++; p == pe { - goto _test_eof249 - } - st_case_249: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st250 - } - goto tr19 - st250: - if p++; p == pe { - goto _test_eof250 - } - st_case_250: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st251 - } - goto tr19 - st251: - if p++; p == pe { - goto _test_eof251 - } - st_case_251: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st252 - } - goto tr19 - st252: - if p++; p == pe { - goto _test_eof252 - } - st_case_252: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st253 - } - goto tr19 - st253: - if p++; p == pe { - goto _test_eof253 - } - st_case_253: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st254 - } - goto tr19 - st254: - if p++; p == pe { - goto _test_eof254 - } - st_case_254: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st255 - } - goto tr19 - st255: - if p++; p == pe { - goto _test_eof255 - } - st_case_255: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st256 - } - goto tr19 - st256: - if p++; p == pe { - goto _test_eof256 - } - st_case_256: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st257 - } - goto tr19 - st257: - if p++; p == pe { - goto _test_eof257 - } - st_case_257: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st258 - } - goto tr19 - st258: - if p++; p == pe { - goto _test_eof258 - } - st_case_258: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st259 - } - goto tr19 - st259: - if p++; p == pe { - goto _test_eof259 - } - st_case_259: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st260 - } - goto tr19 - st260: - if p++; p == pe { - goto _test_eof260 - } - st_case_260: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st261 - } - goto tr19 - st261: - if p++; p == pe { - goto _test_eof261 - } - st_case_261: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st262 - } - goto tr19 - st262: - if p++; p == pe { - goto _test_eof262 - } - st_case_262: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st263 - } - goto tr19 - st263: - if p++; p == pe { - goto _test_eof263 - } - st_case_263: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st264 - } - goto tr19 - st264: - if p++; p == pe { - goto _test_eof264 - } - st_case_264: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st265 - } - goto tr19 - st265: - if p++; p == pe { - goto _test_eof265 - } - st_case_265: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st266 - } - goto tr19 - st266: - if p++; p == pe { - goto _test_eof266 - } - st_case_266: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st267 - } - goto tr19 - st267: - if p++; p == pe { - goto _test_eof267 - } - st_case_267: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st268 - } - goto tr19 - st268: - if p++; p == pe { - goto _test_eof268 - } - st_case_268: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st269 - } - goto tr19 - st269: - if p++; p == pe { - goto _test_eof269 - } - st_case_269: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st270 - } - goto tr19 - st270: - if p++; p == pe { - goto _test_eof270 - } - st_case_270: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st271 - } - goto tr19 - st271: - if p++; p == pe { - goto _test_eof271 - } - st_case_271: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st272 - } - goto tr19 - st272: - if p++; p == pe { - goto _test_eof272 - } - st_case_272: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st273 - } - goto tr19 - st273: - if p++; p == pe { - goto _test_eof273 - } - st_case_273: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st274 - } - goto tr19 - st274: - if p++; p == pe { - goto _test_eof274 - } - st_case_274: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st275 - } - goto tr19 - st275: - if p++; p == pe { - goto _test_eof275 - } - st_case_275: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st276 - } - goto tr19 - st276: - if p++; p == pe { - goto _test_eof276 - } - st_case_276: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st277 - } - goto tr19 - st277: - if p++; p == pe { - goto _test_eof277 - } - st_case_277: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st278 - } - goto tr19 - st278: - if p++; p == pe { - goto _test_eof278 - } - st_case_278: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st279 - } - goto tr19 - st279: - if p++; p == pe { - goto _test_eof279 - } - st_case_279: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st280 - } - goto tr19 - st280: - if p++; p == pe { - goto _test_eof280 - } - st_case_280: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st281 - } - goto tr19 - st281: - if p++; p == pe { - goto _test_eof281 - } - st_case_281: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st282 - } - goto tr19 - st282: - if p++; p == pe { - goto _test_eof282 - } - st_case_282: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st283 - } - goto tr19 - st283: - if p++; p == pe { - goto _test_eof283 - } - st_case_283: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st284 - } - goto tr19 - st284: - if p++; p == pe { - goto _test_eof284 - } - st_case_284: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st285 - } - goto tr19 - st285: - if p++; p == pe { - goto _test_eof285 - } - st_case_285: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st286 - } - goto tr19 - st286: - if p++; p == pe { - goto _test_eof286 - } - st_case_286: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st287 - } - goto tr19 - st287: - if p++; p == pe { - goto _test_eof287 - } - st_case_287: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st288 - } - goto tr19 - st288: - if p++; p == pe { - goto _test_eof288 - } - st_case_288: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st289 - } - goto tr19 - st289: - if p++; p == pe { - goto _test_eof289 - } - st_case_289: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st290 - } - goto tr19 - st290: - if p++; p == pe { - goto _test_eof290 - } - st_case_290: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st291 - } - goto tr19 - st291: - if p++; p == pe { - goto _test_eof291 - } - st_case_291: - if data[p] == 32 { - goto tr21 - } - if 33 <= data[p] && data[p] <= 126 { - goto st292 - } - goto tr19 - st292: - if p++; p == pe { - goto _test_eof292 - } - st_case_292: - if data[p] == 32 { - goto tr21 - } - goto tr19 - st293: - if p++; p == pe { - goto _test_eof293 - } - st_case_293: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st294 - } - goto tr15 - st294: - if p++; p == pe { - goto _test_eof294 - } - st_case_294: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st295 - } - goto tr15 - st295: - if p++; p == pe { - goto _test_eof295 - } - st_case_295: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st296 - } - goto tr15 - st296: - if p++; p == pe { - goto _test_eof296 - } - st_case_296: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st297 - } - goto tr15 - st297: - if p++; p == pe { - goto _test_eof297 - } - st_case_297: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st298 - } - goto tr15 - st298: - if p++; p == pe { - goto _test_eof298 - } - st_case_298: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st299 - } - goto tr15 - st299: - if p++; p == pe { - goto _test_eof299 - } - st_case_299: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st300 - } - goto tr15 - st300: - if p++; p == pe { - goto _test_eof300 - } - st_case_300: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st301 - } - goto tr15 - st301: - if p++; p == pe { - goto _test_eof301 - } - st_case_301: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st302 - } - goto tr15 - st302: - if p++; p == pe { - goto _test_eof302 - } - st_case_302: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st303 - } - goto tr15 - st303: - if p++; p == pe { - goto _test_eof303 - } - st_case_303: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st304 - } - goto tr15 - st304: - if p++; p == pe { - goto _test_eof304 - } - st_case_304: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st305 - } - goto tr15 - st305: - if p++; p == pe { - goto _test_eof305 - } - st_case_305: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st306 - } - goto tr15 - st306: - if p++; p == pe { - goto _test_eof306 - } - st_case_306: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st307 - } - goto tr15 - st307: - if p++; p == pe { - goto _test_eof307 - } - st_case_307: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st308 - } - goto tr15 - st308: - if p++; p == pe { - goto _test_eof308 - } - st_case_308: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st309 - } - goto tr15 - st309: - if p++; p == pe { - goto _test_eof309 - } - st_case_309: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st310 - } - goto tr15 - st310: - if p++; p == pe { - goto _test_eof310 - } - st_case_310: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st311 - } - goto tr15 - st311: - if p++; p == pe { - goto _test_eof311 - } - st_case_311: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st312 - } - goto tr15 - st312: - if p++; p == pe { - goto _test_eof312 - } - st_case_312: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st313 - } - goto tr15 - st313: - if p++; p == pe { - goto _test_eof313 - } - st_case_313: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st314 - } - goto tr15 - st314: - if p++; p == pe { - goto _test_eof314 - } - st_case_314: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st315 - } - goto tr15 - st315: - if p++; p == pe { - goto _test_eof315 - } - st_case_315: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st316 - } - goto tr15 - st316: - if p++; p == pe { - goto _test_eof316 - } - st_case_316: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st317 - } - goto tr15 - st317: - if p++; p == pe { - goto _test_eof317 - } - st_case_317: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st318 - } - goto tr15 - st318: - if p++; p == pe { - goto _test_eof318 - } - st_case_318: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st319 - } - goto tr15 - st319: - if p++; p == pe { - goto _test_eof319 - } - st_case_319: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st320 - } - goto tr15 - st320: - if p++; p == pe { - goto _test_eof320 - } - st_case_320: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st321 - } - goto tr15 - st321: - if p++; p == pe { - goto _test_eof321 - } - st_case_321: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st322 - } - goto tr15 - st322: - if p++; p == pe { - goto _test_eof322 - } - st_case_322: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st323 - } - goto tr15 - st323: - if p++; p == pe { - goto _test_eof323 - } - st_case_323: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st324 - } - goto tr15 - st324: - if p++; p == pe { - goto _test_eof324 - } - st_case_324: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st325 - } - goto tr15 - st325: - if p++; p == pe { - goto _test_eof325 - } - st_case_325: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st326 - } - goto tr15 - st326: - if p++; p == pe { - goto _test_eof326 - } - st_case_326: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st327 - } - goto tr15 - st327: - if p++; p == pe { - goto _test_eof327 - } - st_case_327: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st328 - } - goto tr15 - st328: - if p++; p == pe { - goto _test_eof328 - } - st_case_328: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st329 - } - goto tr15 - st329: - if p++; p == pe { - goto _test_eof329 - } - st_case_329: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st330 - } - goto tr15 - st330: - if p++; p == pe { - goto _test_eof330 - } - st_case_330: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st331 - } - goto tr15 - st331: - if p++; p == pe { - goto _test_eof331 - } - st_case_331: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st332 - } - goto tr15 - st332: - if p++; p == pe { - goto _test_eof332 - } - st_case_332: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st333 - } - goto tr15 - st333: - if p++; p == pe { - goto _test_eof333 - } - st_case_333: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st334 - } - goto tr15 - st334: - if p++; p == pe { - goto _test_eof334 - } - st_case_334: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st335 - } - goto tr15 - st335: - if p++; p == pe { - goto _test_eof335 - } - st_case_335: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st336 - } - goto tr15 - st336: - if p++; p == pe { - goto _test_eof336 - } - st_case_336: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st337 - } - goto tr15 - st337: - if p++; p == pe { - goto _test_eof337 - } - st_case_337: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st338 - } - goto tr15 - st338: - if p++; p == pe { - goto _test_eof338 - } - st_case_338: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st339 - } - goto tr15 - st339: - if p++; p == pe { - goto _test_eof339 - } - st_case_339: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st340 - } - goto tr15 - st340: - if p++; p == pe { - goto _test_eof340 - } - st_case_340: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st341 - } - goto tr15 - st341: - if p++; p == pe { - goto _test_eof341 - } - st_case_341: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st342 - } - goto tr15 - st342: - if p++; p == pe { - goto _test_eof342 - } - st_case_342: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st343 - } - goto tr15 - st343: - if p++; p == pe { - goto _test_eof343 - } - st_case_343: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st344 - } - goto tr15 - st344: - if p++; p == pe { - goto _test_eof344 - } - st_case_344: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st345 - } - goto tr15 - st345: - if p++; p == pe { - goto _test_eof345 - } - st_case_345: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st346 - } - goto tr15 - st346: - if p++; p == pe { - goto _test_eof346 - } - st_case_346: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st347 - } - goto tr15 - st347: - if p++; p == pe { - goto _test_eof347 - } - st_case_347: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st348 - } - goto tr15 - st348: - if p++; p == pe { - goto _test_eof348 - } - st_case_348: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st349 - } - goto tr15 - st349: - if p++; p == pe { - goto _test_eof349 - } - st_case_349: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st350 - } - goto tr15 - st350: - if p++; p == pe { - goto _test_eof350 - } - st_case_350: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st351 - } - goto tr15 - st351: - if p++; p == pe { - goto _test_eof351 - } - st_case_351: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st352 - } - goto tr15 - st352: - if p++; p == pe { - goto _test_eof352 - } - st_case_352: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st353 - } - goto tr15 - st353: - if p++; p == pe { - goto _test_eof353 - } - st_case_353: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st354 - } - goto tr15 - st354: - if p++; p == pe { - goto _test_eof354 - } - st_case_354: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st355 - } - goto tr15 - st355: - if p++; p == pe { - goto _test_eof355 - } - st_case_355: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st356 - } - goto tr15 - st356: - if p++; p == pe { - goto _test_eof356 - } - st_case_356: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st357 - } - goto tr15 - st357: - if p++; p == pe { - goto _test_eof357 - } - st_case_357: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st358 - } - goto tr15 - st358: - if p++; p == pe { - goto _test_eof358 - } - st_case_358: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st359 - } - goto tr15 - st359: - if p++; p == pe { - goto _test_eof359 - } - st_case_359: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st360 - } - goto tr15 - st360: - if p++; p == pe { - goto _test_eof360 - } - st_case_360: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st361 - } - goto tr15 - st361: - if p++; p == pe { - goto _test_eof361 - } - st_case_361: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st362 - } - goto tr15 - st362: - if p++; p == pe { - goto _test_eof362 - } - st_case_362: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st363 - } - goto tr15 - st363: - if p++; p == pe { - goto _test_eof363 - } - st_case_363: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st364 - } - goto tr15 - st364: - if p++; p == pe { - goto _test_eof364 - } - st_case_364: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st365 - } - goto tr15 - st365: - if p++; p == pe { - goto _test_eof365 - } - st_case_365: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st366 - } - goto tr15 - st366: - if p++; p == pe { - goto _test_eof366 - } - st_case_366: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st367 - } - goto tr15 - st367: - if p++; p == pe { - goto _test_eof367 - } - st_case_367: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st368 - } - goto tr15 - st368: - if p++; p == pe { - goto _test_eof368 - } - st_case_368: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st369 - } - goto tr15 - st369: - if p++; p == pe { - goto _test_eof369 - } - st_case_369: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st370 - } - goto tr15 - st370: - if p++; p == pe { - goto _test_eof370 - } - st_case_370: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st371 - } - goto tr15 - st371: - if p++; p == pe { - goto _test_eof371 - } - st_case_371: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st372 - } - goto tr15 - st372: - if p++; p == pe { - goto _test_eof372 - } - st_case_372: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st373 - } - goto tr15 - st373: - if p++; p == pe { - goto _test_eof373 - } - st_case_373: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st374 - } - goto tr15 - st374: - if p++; p == pe { - goto _test_eof374 - } - st_case_374: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st375 - } - goto tr15 - st375: - if p++; p == pe { - goto _test_eof375 - } - st_case_375: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st376 - } - goto tr15 - st376: - if p++; p == pe { - goto _test_eof376 - } - st_case_376: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st377 - } - goto tr15 - st377: - if p++; p == pe { - goto _test_eof377 - } - st_case_377: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st378 - } - goto tr15 - st378: - if p++; p == pe { - goto _test_eof378 - } - st_case_378: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st379 - } - goto tr15 - st379: - if p++; p == pe { - goto _test_eof379 - } - st_case_379: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st380 - } - goto tr15 - st380: - if p++; p == pe { - goto _test_eof380 - } - st_case_380: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st381 - } - goto tr15 - st381: - if p++; p == pe { - goto _test_eof381 - } - st_case_381: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st382 - } - goto tr15 - st382: - if p++; p == pe { - goto _test_eof382 - } - st_case_382: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st383 - } - goto tr15 - st383: - if p++; p == pe { - goto _test_eof383 - } - st_case_383: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st384 - } - goto tr15 - st384: - if p++; p == pe { - goto _test_eof384 - } - st_case_384: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st385 - } - goto tr15 - st385: - if p++; p == pe { - goto _test_eof385 - } - st_case_385: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st386 - } - goto tr15 - st386: - if p++; p == pe { - goto _test_eof386 - } - st_case_386: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st387 - } - goto tr15 - st387: - if p++; p == pe { - goto _test_eof387 - } - st_case_387: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st388 - } - goto tr15 - st388: - if p++; p == pe { - goto _test_eof388 - } - st_case_388: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st389 - } - goto tr15 - st389: - if p++; p == pe { - goto _test_eof389 - } - st_case_389: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st390 - } - goto tr15 - st390: - if p++; p == pe { - goto _test_eof390 - } - st_case_390: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st391 - } - goto tr15 - st391: - if p++; p == pe { - goto _test_eof391 - } - st_case_391: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st392 - } - goto tr15 - st392: - if p++; p == pe { - goto _test_eof392 - } - st_case_392: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st393 - } - goto tr15 - st393: - if p++; p == pe { - goto _test_eof393 - } - st_case_393: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st394 - } - goto tr15 - st394: - if p++; p == pe { - goto _test_eof394 - } - st_case_394: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st395 - } - goto tr15 - st395: - if p++; p == pe { - goto _test_eof395 - } - st_case_395: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st396 - } - goto tr15 - st396: - if p++; p == pe { - goto _test_eof396 - } - st_case_396: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st397 - } - goto tr15 - st397: - if p++; p == pe { - goto _test_eof397 - } - st_case_397: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st398 - } - goto tr15 - st398: - if p++; p == pe { - goto _test_eof398 - } - st_case_398: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st399 - } - goto tr15 - st399: - if p++; p == pe { - goto _test_eof399 - } - st_case_399: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st400 - } - goto tr15 - st400: - if p++; p == pe { - goto _test_eof400 - } - st_case_400: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st401 - } - goto tr15 - st401: - if p++; p == pe { - goto _test_eof401 - } - st_case_401: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st402 - } - goto tr15 - st402: - if p++; p == pe { - goto _test_eof402 - } - st_case_402: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st403 - } - goto tr15 - st403: - if p++; p == pe { - goto _test_eof403 - } - st_case_403: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st404 - } - goto tr15 - st404: - if p++; p == pe { - goto _test_eof404 - } - st_case_404: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st405 - } - goto tr15 - st405: - if p++; p == pe { - goto _test_eof405 - } - st_case_405: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st406 - } - goto tr15 - st406: - if p++; p == pe { - goto _test_eof406 - } - st_case_406: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st407 - } - goto tr15 - st407: - if p++; p == pe { - goto _test_eof407 - } - st_case_407: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st408 - } - goto tr15 - st408: - if p++; p == pe { - goto _test_eof408 - } - st_case_408: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st409 - } - goto tr15 - st409: - if p++; p == pe { - goto _test_eof409 - } - st_case_409: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st410 - } - goto tr15 - st410: - if p++; p == pe { - goto _test_eof410 - } - st_case_410: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st411 - } - goto tr15 - st411: - if p++; p == pe { - goto _test_eof411 - } - st_case_411: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st412 - } - goto tr15 - st412: - if p++; p == pe { - goto _test_eof412 - } - st_case_412: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st413 - } - goto tr15 - st413: - if p++; p == pe { - goto _test_eof413 - } - st_case_413: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st414 - } - goto tr15 - st414: - if p++; p == pe { - goto _test_eof414 - } - st_case_414: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st415 - } - goto tr15 - st415: - if p++; p == pe { - goto _test_eof415 - } - st_case_415: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st416 - } - goto tr15 - st416: - if p++; p == pe { - goto _test_eof416 - } - st_case_416: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st417 - } - goto tr15 - st417: - if p++; p == pe { - goto _test_eof417 - } - st_case_417: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st418 - } - goto tr15 - st418: - if p++; p == pe { - goto _test_eof418 - } - st_case_418: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st419 - } - goto tr15 - st419: - if p++; p == pe { - goto _test_eof419 - } - st_case_419: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st420 - } - goto tr15 - st420: - if p++; p == pe { - goto _test_eof420 - } - st_case_420: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st421 - } - goto tr15 - st421: - if p++; p == pe { - goto _test_eof421 - } - st_case_421: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st422 - } - goto tr15 - st422: - if p++; p == pe { - goto _test_eof422 - } - st_case_422: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st423 - } - goto tr15 - st423: - if p++; p == pe { - goto _test_eof423 - } - st_case_423: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st424 - } - goto tr15 - st424: - if p++; p == pe { - goto _test_eof424 - } - st_case_424: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st425 - } - goto tr15 - st425: - if p++; p == pe { - goto _test_eof425 - } - st_case_425: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st426 - } - goto tr15 - st426: - if p++; p == pe { - goto _test_eof426 - } - st_case_426: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st427 - } - goto tr15 - st427: - if p++; p == pe { - goto _test_eof427 - } - st_case_427: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st428 - } - goto tr15 - st428: - if p++; p == pe { - goto _test_eof428 - } - st_case_428: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st429 - } - goto tr15 - st429: - if p++; p == pe { - goto _test_eof429 - } - st_case_429: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st430 - } - goto tr15 - st430: - if p++; p == pe { - goto _test_eof430 - } - st_case_430: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st431 - } - goto tr15 - st431: - if p++; p == pe { - goto _test_eof431 - } - st_case_431: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st432 - } - goto tr15 - st432: - if p++; p == pe { - goto _test_eof432 - } - st_case_432: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st433 - } - goto tr15 - st433: - if p++; p == pe { - goto _test_eof433 - } - st_case_433: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st434 - } - goto tr15 - st434: - if p++; p == pe { - goto _test_eof434 - } - st_case_434: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st435 - } - goto tr15 - st435: - if p++; p == pe { - goto _test_eof435 - } - st_case_435: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st436 - } - goto tr15 - st436: - if p++; p == pe { - goto _test_eof436 - } - st_case_436: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st437 - } - goto tr15 - st437: - if p++; p == pe { - goto _test_eof437 - } - st_case_437: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st438 - } - goto tr15 - st438: - if p++; p == pe { - goto _test_eof438 - } - st_case_438: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st439 - } - goto tr15 - st439: - if p++; p == pe { - goto _test_eof439 - } - st_case_439: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st440 - } - goto tr15 - st440: - if p++; p == pe { - goto _test_eof440 - } - st_case_440: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st441 - } - goto tr15 - st441: - if p++; p == pe { - goto _test_eof441 - } - st_case_441: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st442 - } - goto tr15 - st442: - if p++; p == pe { - goto _test_eof442 - } - st_case_442: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st443 - } - goto tr15 - st443: - if p++; p == pe { - goto _test_eof443 - } - st_case_443: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st444 - } - goto tr15 - st444: - if p++; p == pe { - goto _test_eof444 - } - st_case_444: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st445 - } - goto tr15 - st445: - if p++; p == pe { - goto _test_eof445 - } - st_case_445: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st446 - } - goto tr15 - st446: - if p++; p == pe { - goto _test_eof446 - } - st_case_446: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st447 - } - goto tr15 - st447: - if p++; p == pe { - goto _test_eof447 - } - st_case_447: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st448 - } - goto tr15 - st448: - if p++; p == pe { - goto _test_eof448 - } - st_case_448: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st449 - } - goto tr15 - st449: - if p++; p == pe { - goto _test_eof449 - } - st_case_449: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st450 - } - goto tr15 - st450: - if p++; p == pe { - goto _test_eof450 - } - st_case_450: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st451 - } - goto tr15 - st451: - if p++; p == pe { - goto _test_eof451 - } - st_case_451: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st452 - } - goto tr15 - st452: - if p++; p == pe { - goto _test_eof452 - } - st_case_452: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st453 - } - goto tr15 - st453: - if p++; p == pe { - goto _test_eof453 - } - st_case_453: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st454 - } - goto tr15 - st454: - if p++; p == pe { - goto _test_eof454 - } - st_case_454: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st455 - } - goto tr15 - st455: - if p++; p == pe { - goto _test_eof455 - } - st_case_455: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st456 - } - goto tr15 - st456: - if p++; p == pe { - goto _test_eof456 - } - st_case_456: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st457 - } - goto tr15 - st457: - if p++; p == pe { - goto _test_eof457 - } - st_case_457: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st458 - } - goto tr15 - st458: - if p++; p == pe { - goto _test_eof458 - } - st_case_458: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st459 - } - goto tr15 - st459: - if p++; p == pe { - goto _test_eof459 - } - st_case_459: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st460 - } - goto tr15 - st460: - if p++; p == pe { - goto _test_eof460 - } - st_case_460: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st461 - } - goto tr15 - st461: - if p++; p == pe { - goto _test_eof461 - } - st_case_461: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st462 - } - goto tr15 - st462: - if p++; p == pe { - goto _test_eof462 - } - st_case_462: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st463 - } - goto tr15 - st463: - if p++; p == pe { - goto _test_eof463 - } - st_case_463: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st464 - } - goto tr15 - st464: - if p++; p == pe { - goto _test_eof464 - } - st_case_464: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st465 - } - goto tr15 - st465: - if p++; p == pe { - goto _test_eof465 - } - st_case_465: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st466 - } - goto tr15 - st466: - if p++; p == pe { - goto _test_eof466 - } - st_case_466: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st467 - } - goto tr15 - st467: - if p++; p == pe { - goto _test_eof467 - } - st_case_467: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st468 - } - goto tr15 - st468: - if p++; p == pe { - goto _test_eof468 - } - st_case_468: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st469 - } - goto tr15 - st469: - if p++; p == pe { - goto _test_eof469 - } - st_case_469: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st470 - } - goto tr15 - st470: - if p++; p == pe { - goto _test_eof470 - } - st_case_470: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st471 - } - goto tr15 - st471: - if p++; p == pe { - goto _test_eof471 - } - st_case_471: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st472 - } - goto tr15 - st472: - if p++; p == pe { - goto _test_eof472 - } - st_case_472: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st473 - } - goto tr15 - st473: - if p++; p == pe { - goto _test_eof473 - } - st_case_473: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st474 - } - goto tr15 - st474: - if p++; p == pe { - goto _test_eof474 - } - st_case_474: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st475 - } - goto tr15 - st475: - if p++; p == pe { - goto _test_eof475 - } - st_case_475: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st476 - } - goto tr15 - st476: - if p++; p == pe { - goto _test_eof476 - } - st_case_476: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st477 - } - goto tr15 - st477: - if p++; p == pe { - goto _test_eof477 - } - st_case_477: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st478 - } - goto tr15 - st478: - if p++; p == pe { - goto _test_eof478 - } - st_case_478: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st479 - } - goto tr15 - st479: - if p++; p == pe { - goto _test_eof479 - } - st_case_479: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st480 - } - goto tr15 - st480: - if p++; p == pe { - goto _test_eof480 - } - st_case_480: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st481 - } - goto tr15 - st481: - if p++; p == pe { - goto _test_eof481 - } - st_case_481: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st482 - } - goto tr15 - st482: - if p++; p == pe { - goto _test_eof482 - } - st_case_482: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st483 - } - goto tr15 - st483: - if p++; p == pe { - goto _test_eof483 - } - st_case_483: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st484 - } - goto tr15 - st484: - if p++; p == pe { - goto _test_eof484 - } - st_case_484: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st485 - } - goto tr15 - st485: - if p++; p == pe { - goto _test_eof485 - } - st_case_485: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st486 - } - goto tr15 - st486: - if p++; p == pe { - goto _test_eof486 - } - st_case_486: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st487 - } - goto tr15 - st487: - if p++; p == pe { - goto _test_eof487 - } - st_case_487: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st488 - } - goto tr15 - st488: - if p++; p == pe { - goto _test_eof488 - } - st_case_488: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st489 - } - goto tr15 - st489: - if p++; p == pe { - goto _test_eof489 - } - st_case_489: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st490 - } - goto tr15 - st490: - if p++; p == pe { - goto _test_eof490 - } - st_case_490: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st491 - } - goto tr15 - st491: - if p++; p == pe { - goto _test_eof491 - } - st_case_491: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st492 - } - goto tr15 - st492: - if p++; p == pe { - goto _test_eof492 - } - st_case_492: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st493 - } - goto tr15 - st493: - if p++; p == pe { - goto _test_eof493 - } - st_case_493: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st494 - } - goto tr15 - st494: - if p++; p == pe { - goto _test_eof494 - } - st_case_494: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st495 - } - goto tr15 - st495: - if p++; p == pe { - goto _test_eof495 - } - st_case_495: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st496 - } - goto tr15 - st496: - if p++; p == pe { - goto _test_eof496 - } - st_case_496: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st497 - } - goto tr15 - st497: - if p++; p == pe { - goto _test_eof497 - } - st_case_497: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st498 - } - goto tr15 - st498: - if p++; p == pe { - goto _test_eof498 - } - st_case_498: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st499 - } - goto tr15 - st499: - if p++; p == pe { - goto _test_eof499 - } - st_case_499: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st500 - } - goto tr15 - st500: - if p++; p == pe { - goto _test_eof500 - } - st_case_500: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st501 - } - goto tr15 - st501: - if p++; p == pe { - goto _test_eof501 - } - st_case_501: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st502 - } - goto tr15 - st502: - if p++; p == pe { - goto _test_eof502 - } - st_case_502: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st503 - } - goto tr15 - st503: - if p++; p == pe { - goto _test_eof503 - } - st_case_503: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st504 - } - goto tr15 - st504: - if p++; p == pe { - goto _test_eof504 - } - st_case_504: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st505 - } - goto tr15 - st505: - if p++; p == pe { - goto _test_eof505 - } - st_case_505: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st506 - } - goto tr15 - st506: - if p++; p == pe { - goto _test_eof506 - } - st_case_506: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st507 - } - goto tr15 - st507: - if p++; p == pe { - goto _test_eof507 - } - st_case_507: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st508 - } - goto tr15 - st508: - if p++; p == pe { - goto _test_eof508 - } - st_case_508: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st509 - } - goto tr15 - st509: - if p++; p == pe { - goto _test_eof509 - } - st_case_509: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st510 - } - goto tr15 - st510: - if p++; p == pe { - goto _test_eof510 - } - st_case_510: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st511 - } - goto tr15 - st511: - if p++; p == pe { - goto _test_eof511 - } - st_case_511: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st512 - } - goto tr15 - st512: - if p++; p == pe { - goto _test_eof512 - } - st_case_512: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st513 - } - goto tr15 - st513: - if p++; p == pe { - goto _test_eof513 - } - st_case_513: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st514 - } - goto tr15 - st514: - if p++; p == pe { - goto _test_eof514 - } - st_case_514: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st515 - } - goto tr15 - st515: - if p++; p == pe { - goto _test_eof515 - } - st_case_515: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st516 - } - goto tr15 - st516: - if p++; p == pe { - goto _test_eof516 - } - st_case_516: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st517 - } - goto tr15 - st517: - if p++; p == pe { - goto _test_eof517 - } - st_case_517: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st518 - } - goto tr15 - st518: - if p++; p == pe { - goto _test_eof518 - } - st_case_518: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st519 - } - goto tr15 - st519: - if p++; p == pe { - goto _test_eof519 - } - st_case_519: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st520 - } - goto tr15 - st520: - if p++; p == pe { - goto _test_eof520 - } - st_case_520: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st521 - } - goto tr15 - st521: - if p++; p == pe { - goto _test_eof521 - } - st_case_521: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st522 - } - goto tr15 - st522: - if p++; p == pe { - goto _test_eof522 - } - st_case_522: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st523 - } - goto tr15 - st523: - if p++; p == pe { - goto _test_eof523 - } - st_case_523: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st524 - } - goto tr15 - st524: - if p++; p == pe { - goto _test_eof524 - } - st_case_524: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st525 - } - goto tr15 - st525: - if p++; p == pe { - goto _test_eof525 - } - st_case_525: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st526 - } - goto tr15 - st526: - if p++; p == pe { - goto _test_eof526 - } - st_case_526: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st527 - } - goto tr15 - st527: - if p++; p == pe { - goto _test_eof527 - } - st_case_527: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st528 - } - goto tr15 - st528: - if p++; p == pe { - goto _test_eof528 - } - st_case_528: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st529 - } - goto tr15 - st529: - if p++; p == pe { - goto _test_eof529 - } - st_case_529: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st530 - } - goto tr15 - st530: - if p++; p == pe { - goto _test_eof530 - } - st_case_530: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st531 - } - goto tr15 - st531: - if p++; p == pe { - goto _test_eof531 - } - st_case_531: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st532 - } - goto tr15 - st532: - if p++; p == pe { - goto _test_eof532 - } - st_case_532: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st533 - } - goto tr15 - st533: - if p++; p == pe { - goto _test_eof533 - } - st_case_533: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st534 - } - goto tr15 - st534: - if p++; p == pe { - goto _test_eof534 - } - st_case_534: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st535 - } - goto tr15 - st535: - if p++; p == pe { - goto _test_eof535 - } - st_case_535: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st536 - } - goto tr15 - st536: - if p++; p == pe { - goto _test_eof536 - } - st_case_536: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st537 - } - goto tr15 - st537: - if p++; p == pe { - goto _test_eof537 - } - st_case_537: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st538 - } - goto tr15 - st538: - if p++; p == pe { - goto _test_eof538 - } - st_case_538: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st539 - } - goto tr15 - st539: - if p++; p == pe { - goto _test_eof539 - } - st_case_539: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st540 - } - goto tr15 - st540: - if p++; p == pe { - goto _test_eof540 - } - st_case_540: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st541 - } - goto tr15 - st541: - if p++; p == pe { - goto _test_eof541 - } - st_case_541: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st542 - } - goto tr15 - st542: - if p++; p == pe { - goto _test_eof542 - } - st_case_542: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st543 - } - goto tr15 - st543: - if p++; p == pe { - goto _test_eof543 - } - st_case_543: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st544 - } - goto tr15 - st544: - if p++; p == pe { - goto _test_eof544 - } - st_case_544: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st545 - } - goto tr15 - st545: - if p++; p == pe { - goto _test_eof545 - } - st_case_545: - if data[p] == 32 { - goto tr17 - } - if 33 <= data[p] && data[p] <= 126 { - goto st546 - } - goto tr15 - st546: - if p++; p == pe { - goto _test_eof546 - } - st_case_546: - if data[p] == 32 { - goto tr17 - } - goto tr15 - tr13: -//line parser/common.rl:4 - - tok = p - - goto st547 - st547: - if p++; p == pe { - goto _test_eof547 - } - st_case_547: -//line rfc5424_gen.go:8654 - if 48 <= data[p] && data[p] <= 57 { - goto st548 - } - goto tr11 - st548: - if p++; p == pe { - goto _test_eof548 - } - st_case_548: - if 48 <= data[p] && data[p] <= 57 { - goto st549 - } - goto tr11 - st549: - if p++; p == pe { - goto _test_eof549 - } - st_case_549: - if 48 <= data[p] && data[p] <= 57 { - goto st550 - } - goto tr11 - st550: - if p++; p == pe { - goto _test_eof550 - } - st_case_550: - if data[p] == 45 { - goto st551 - } - goto tr11 - st551: - if p++; p == pe { - goto _test_eof551 - } - st_case_551: - switch data[p] { - case 48: - goto st552 - case 49: - goto st583 - } - goto tr11 - st552: - if p++; p == pe { - goto _test_eof552 - } - st_case_552: - if 49 <= data[p] && data[p] <= 57 { - goto st553 - } - goto tr11 - st553: - if p++; p == pe { - goto _test_eof553 - } - st_case_553: - if data[p] == 45 { - goto st554 - } - goto tr11 - st554: - if p++; p == pe { - goto _test_eof554 - } - st_case_554: - switch data[p] { - case 48: - goto st555 - case 51: - goto st582 - } - if 49 <= data[p] && data[p] <= 50 { - goto st581 - } - goto tr11 - st555: - if p++; p == pe { - goto _test_eof555 - } - st_case_555: - if 49 <= data[p] && data[p] <= 57 { - goto st556 - } - goto tr11 - st556: - if p++; p == pe { - goto _test_eof556 - } - st_case_556: - if data[p] == 84 { - goto st557 - } - goto tr11 - st557: - if p++; p == pe { - goto _test_eof557 - } - st_case_557: - if data[p] == 50 { - goto st580 - } - if 48 <= data[p] && data[p] <= 49 { - goto st558 - } - goto tr11 - st558: - if p++; p == pe { - goto _test_eof558 - } - st_case_558: - if 48 <= data[p] && data[p] <= 57 { - goto st559 - } - goto tr11 - st559: - if p++; p == pe { - goto _test_eof559 - } - st_case_559: - if data[p] == 58 { - goto st560 - } - goto tr11 - st560: - if p++; p == pe { - goto _test_eof560 - } - st_case_560: - if 48 <= data[p] && data[p] <= 53 { - goto st561 - } - goto tr11 - st561: - if p++; p == pe { - goto _test_eof561 - } - st_case_561: - if 48 <= data[p] && data[p] <= 57 { - goto st562 - } - goto tr11 - st562: - if p++; p == pe { - goto _test_eof562 - } - st_case_562: - if data[p] == 58 { - goto st563 - } - goto tr11 - st563: - if p++; p == pe { - goto _test_eof563 - } - st_case_563: - if 48 <= data[p] && data[p] <= 53 { - goto st564 - } - goto tr11 - st564: - if p++; p == pe { - goto _test_eof564 - } - st_case_564: - if 48 <= data[p] && data[p] <= 57 { - goto st565 - } - goto tr11 - st565: - if p++; p == pe { - goto _test_eof565 - } - st_case_565: - switch data[p] { - case 43: - goto st566 - case 45: - goto st566 - case 46: - goto st573 - case 90: - goto st571 - } - goto tr11 - st566: - if p++; p == pe { - goto _test_eof566 - } - st_case_566: - if data[p] == 50 { - goto st572 - } - if 48 <= data[p] && data[p] <= 49 { - goto st567 - } - goto tr11 - st567: - if p++; p == pe { - goto _test_eof567 - } - st_case_567: - if 48 <= data[p] && data[p] <= 57 { - goto st568 - } - goto tr11 - st568: - if p++; p == pe { - goto _test_eof568 - } - st_case_568: - if data[p] == 58 { - goto st569 - } - goto tr11 - st569: - if p++; p == pe { - goto _test_eof569 - } - st_case_569: - if 48 <= data[p] && data[p] <= 53 { - goto st570 - } - goto tr11 - st570: - if p++; p == pe { - goto _test_eof570 - } - st_case_570: - if 48 <= data[p] && data[p] <= 57 { - goto st571 - } - goto tr11 - st571: - if p++; p == pe { - goto _test_eof571 - } - st_case_571: - if data[p] == 32 { - goto tr596 - } - goto tr11 - st572: - if p++; p == pe { - goto _test_eof572 - } - st_case_572: - if 48 <= data[p] && data[p] <= 51 { - goto st568 - } - goto tr11 - st573: - if p++; p == pe { - goto _test_eof573 - } - st_case_573: - if 48 <= data[p] && data[p] <= 57 { - goto st574 - } - goto tr11 - st574: - if p++; p == pe { - goto _test_eof574 - } - st_case_574: - switch data[p] { - case 43: - goto st566 - case 45: - goto st566 - case 90: - goto st571 - } - if 48 <= data[p] && data[p] <= 57 { - goto st575 - } - goto tr11 - st575: - if p++; p == pe { - goto _test_eof575 - } - st_case_575: - switch data[p] { - case 43: - goto st566 - case 45: - goto st566 - case 90: - goto st571 - } - if 48 <= data[p] && data[p] <= 57 { - goto st576 - } - goto tr11 - st576: - if p++; p == pe { - goto _test_eof576 - } - st_case_576: - switch data[p] { - case 43: - goto st566 - case 45: - goto st566 - case 90: - goto st571 - } - if 48 <= data[p] && data[p] <= 57 { - goto st577 - } - goto tr11 - st577: - if p++; p == pe { - goto _test_eof577 - } - st_case_577: - switch data[p] { - case 43: - goto st566 - case 45: - goto st566 - case 90: - goto st571 - } - if 48 <= data[p] && data[p] <= 57 { - goto st578 - } - goto tr11 - st578: - if p++; p == pe { - goto _test_eof578 - } - st_case_578: - switch data[p] { - case 43: - goto st566 - case 45: - goto st566 - case 90: - goto st571 - } - if 48 <= data[p] && data[p] <= 57 { - goto st579 - } - goto tr11 - st579: - if p++; p == pe { - goto _test_eof579 - } - st_case_579: - switch data[p] { - case 43: - goto st566 - case 45: - goto st566 - case 90: - goto st571 - } - goto tr11 - st580: - if p++; p == pe { - goto _test_eof580 - } - st_case_580: - if 48 <= data[p] && data[p] <= 51 { - goto st559 - } - goto tr11 - st581: - if p++; p == pe { - goto _test_eof581 - } - st_case_581: - if 48 <= data[p] && data[p] <= 57 { - goto st556 - } - goto tr11 - st582: - if p++; p == pe { - goto _test_eof582 - } - st_case_582: - if 48 <= data[p] && data[p] <= 49 { - goto st556 - } - goto tr11 - st583: - if p++; p == pe { - goto _test_eof583 - } - st_case_583: - if 48 <= data[p] && data[p] <= 50 { - goto st553 - } - goto tr11 - st584: - if p++; p == pe { - goto _test_eof584 - } - st_case_584: - if data[p] == 32 { - goto tr8 - } - if 48 <= data[p] && data[p] <= 57 { - goto st585 - } - goto st0 - st585: - if p++; p == pe { - goto _test_eof585 - } - st_case_585: - if data[p] == 32 { - goto tr8 - } - goto st0 - tr3: -//line parser/common.rl:4 - - tok = p - - goto st586 - st586: - if p++; p == pe { - goto _test_eof586 - } - st_case_586: -//line rfc5424_gen.go:9082 - switch data[p] { - case 57: - goto st588 - case 62: - goto tr5 - } - if 48 <= data[p] && data[p] <= 56 { - goto st587 - } - goto tr0 - tr4: -//line parser/common.rl:4 - - tok = p - - goto st587 - st587: - if p++; p == pe { - goto _test_eof587 - } - st_case_587: -//line rfc5424_gen.go:9104 - if data[p] == 62 { - goto tr5 - } - if 48 <= data[p] && data[p] <= 57 { - goto st3 - } - goto tr0 - st588: - if p++; p == pe { - goto _test_eof588 - } - st_case_588: - if data[p] == 62 { - goto tr5 - } - if 48 <= data[p] && data[p] <= 49 { - goto st3 - } - goto tr0 - st_out: - _test_eof2: - cs = 2 - goto _test_eof - _test_eof3: - cs = 3 - goto _test_eof - _test_eof4: - cs = 4 - goto _test_eof - _test_eof5: - cs = 5 - goto _test_eof - _test_eof6: - cs = 6 - goto _test_eof - _test_eof7: - cs = 7 - goto _test_eof - _test_eof8: - cs = 8 - goto _test_eof - _test_eof9: - cs = 9 - goto _test_eof - _test_eof10: - cs = 10 - goto _test_eof - _test_eof11: - cs = 11 - goto _test_eof - _test_eof12: - cs = 12 - goto _test_eof - _test_eof13: - cs = 13 - goto _test_eof - _test_eof14: - cs = 14 - goto _test_eof - _test_eof15: - cs = 15 - goto _test_eof - _test_eof16: - cs = 16 - goto _test_eof - _test_eof589: - cs = 589 - goto _test_eof - _test_eof590: - cs = 590 - goto _test_eof - _test_eof591: - cs = 591 - goto _test_eof - _test_eof17: - cs = 17 - goto _test_eof - _test_eof18: - cs = 18 - goto _test_eof - _test_eof19: - cs = 19 - goto _test_eof - _test_eof20: - cs = 20 - goto _test_eof - _test_eof21: - cs = 21 - goto _test_eof - _test_eof22: - cs = 22 - goto _test_eof - _test_eof23: - cs = 23 - goto _test_eof - _test_eof24: - cs = 24 - goto _test_eof - _test_eof25: - cs = 25 - goto _test_eof - _test_eof26: - cs = 26 - goto _test_eof - _test_eof27: - cs = 27 - goto _test_eof - _test_eof28: - cs = 28 - goto _test_eof - _test_eof29: - cs = 29 - goto _test_eof - _test_eof30: - cs = 30 - goto _test_eof - _test_eof31: - cs = 31 - goto _test_eof - _test_eof32: - cs = 32 - goto _test_eof - _test_eof33: - cs = 33 - goto _test_eof - _test_eof34: - cs = 34 - goto _test_eof - _test_eof35: - cs = 35 - goto _test_eof - _test_eof36: - cs = 36 - goto _test_eof - _test_eof37: - cs = 37 - goto _test_eof - _test_eof38: - cs = 38 - goto _test_eof - _test_eof39: - cs = 39 - goto _test_eof - _test_eof40: - cs = 40 - goto _test_eof - _test_eof41: - cs = 41 - goto _test_eof - _test_eof42: - cs = 42 - goto _test_eof - _test_eof43: - cs = 43 - goto _test_eof - _test_eof44: - cs = 44 - goto _test_eof - _test_eof45: - cs = 45 - goto _test_eof - _test_eof46: - cs = 46 - goto _test_eof - _test_eof47: - cs = 47 - goto _test_eof - _test_eof48: - cs = 48 - goto _test_eof - _test_eof49: - cs = 49 - goto _test_eof - _test_eof50: - cs = 50 - goto _test_eof - _test_eof51: - cs = 51 - goto _test_eof - _test_eof52: - cs = 52 - goto _test_eof - _test_eof53: - cs = 53 - goto _test_eof - _test_eof54: - cs = 54 - goto _test_eof - _test_eof55: - cs = 55 - goto _test_eof - _test_eof592: - cs = 592 - goto _test_eof - _test_eof56: - cs = 56 - goto _test_eof - _test_eof57: - cs = 57 - goto _test_eof - _test_eof58: - cs = 58 - goto _test_eof - _test_eof59: - cs = 59 - goto _test_eof - _test_eof60: - cs = 60 - goto _test_eof - _test_eof61: - cs = 61 - goto _test_eof - _test_eof62: - cs = 62 - goto _test_eof - _test_eof63: - cs = 63 - goto _test_eof - _test_eof64: - cs = 64 - goto _test_eof - _test_eof65: - cs = 65 - goto _test_eof - _test_eof66: - cs = 66 - goto _test_eof - _test_eof67: - cs = 67 - goto _test_eof - _test_eof68: - cs = 68 - goto _test_eof - _test_eof69: - cs = 69 - goto _test_eof - _test_eof70: - cs = 70 - goto _test_eof - _test_eof71: - cs = 71 - goto _test_eof - _test_eof72: - cs = 72 - goto _test_eof - _test_eof73: - cs = 73 - goto _test_eof - _test_eof74: - cs = 74 - goto _test_eof - _test_eof75: - cs = 75 - goto _test_eof - _test_eof76: - cs = 76 - goto _test_eof - _test_eof77: - cs = 77 - goto _test_eof - _test_eof78: - cs = 78 - goto _test_eof - _test_eof79: - cs = 79 - goto _test_eof - _test_eof80: - cs = 80 - goto _test_eof - _test_eof81: - cs = 81 - goto _test_eof - _test_eof82: - cs = 82 - goto _test_eof - _test_eof83: - cs = 83 - goto _test_eof - _test_eof84: - cs = 84 - goto _test_eof - _test_eof85: - cs = 85 - goto _test_eof - _test_eof86: - cs = 86 - goto _test_eof - _test_eof87: - cs = 87 - goto _test_eof - _test_eof88: - cs = 88 - goto _test_eof - _test_eof89: - cs = 89 - goto _test_eof - _test_eof90: - cs = 90 - goto _test_eof - _test_eof91: - cs = 91 - goto _test_eof - _test_eof92: - cs = 92 - goto _test_eof - _test_eof93: - cs = 93 - goto _test_eof - _test_eof94: - cs = 94 - goto _test_eof - _test_eof95: - cs = 95 - goto _test_eof - _test_eof96: - cs = 96 - goto _test_eof - _test_eof97: - cs = 97 - goto _test_eof - _test_eof98: - cs = 98 - goto _test_eof - _test_eof99: - cs = 99 - goto _test_eof - _test_eof100: - cs = 100 - goto _test_eof - _test_eof101: - cs = 101 - goto _test_eof - _test_eof102: - cs = 102 - goto _test_eof - _test_eof103: - cs = 103 - goto _test_eof - _test_eof104: - cs = 104 - goto _test_eof - _test_eof105: - cs = 105 - goto _test_eof - _test_eof106: - cs = 106 - goto _test_eof - _test_eof107: - cs = 107 - goto _test_eof - _test_eof108: - cs = 108 - goto _test_eof - _test_eof109: - cs = 109 - goto _test_eof - _test_eof110: - cs = 110 - goto _test_eof - _test_eof111: - cs = 111 - goto _test_eof - _test_eof112: - cs = 112 - goto _test_eof - _test_eof113: - cs = 113 - goto _test_eof - _test_eof114: - cs = 114 - goto _test_eof - _test_eof115: - cs = 115 - goto _test_eof - _test_eof116: - cs = 116 - goto _test_eof - _test_eof117: - cs = 117 - goto _test_eof - _test_eof118: - cs = 118 - goto _test_eof - _test_eof119: - cs = 119 - goto _test_eof - _test_eof120: - cs = 120 - goto _test_eof - _test_eof121: - cs = 121 - goto _test_eof - _test_eof122: - cs = 122 - goto _test_eof - _test_eof123: - cs = 123 - goto _test_eof - _test_eof124: - cs = 124 - goto _test_eof - _test_eof125: - cs = 125 - goto _test_eof - _test_eof126: - cs = 126 - goto _test_eof - _test_eof127: - cs = 127 - goto _test_eof - _test_eof128: - cs = 128 - goto _test_eof - _test_eof129: - cs = 129 - goto _test_eof - _test_eof130: - cs = 130 - goto _test_eof - _test_eof131: - cs = 131 - goto _test_eof - _test_eof132: - cs = 132 - goto _test_eof - _test_eof133: - cs = 133 - goto _test_eof - _test_eof134: - cs = 134 - goto _test_eof - _test_eof135: - cs = 135 - goto _test_eof - _test_eof136: - cs = 136 - goto _test_eof - _test_eof137: - cs = 137 - goto _test_eof - _test_eof138: - cs = 138 - goto _test_eof - _test_eof139: - cs = 139 - goto _test_eof - _test_eof140: - cs = 140 - goto _test_eof - _test_eof141: - cs = 141 - goto _test_eof - _test_eof142: - cs = 142 - goto _test_eof - _test_eof143: - cs = 143 - goto _test_eof - _test_eof144: - cs = 144 - goto _test_eof - _test_eof145: - cs = 145 - goto _test_eof - _test_eof146: - cs = 146 - goto _test_eof - _test_eof147: - cs = 147 - goto _test_eof - _test_eof148: - cs = 148 - goto _test_eof - _test_eof149: - cs = 149 - goto _test_eof - _test_eof150: - cs = 150 - goto _test_eof - _test_eof151: - cs = 151 - goto _test_eof - _test_eof152: - cs = 152 - goto _test_eof - _test_eof153: - cs = 153 - goto _test_eof - _test_eof154: - cs = 154 - goto _test_eof - _test_eof155: - cs = 155 - goto _test_eof - _test_eof156: - cs = 156 - goto _test_eof - _test_eof157: - cs = 157 - goto _test_eof - _test_eof158: - cs = 158 - goto _test_eof - _test_eof159: - cs = 159 - goto _test_eof - _test_eof160: - cs = 160 - goto _test_eof - _test_eof161: - cs = 161 - goto _test_eof - _test_eof162: - cs = 162 - goto _test_eof - _test_eof163: - cs = 163 - goto _test_eof - _test_eof164: - cs = 164 - goto _test_eof - _test_eof165: - cs = 165 - goto _test_eof - _test_eof166: - cs = 166 - goto _test_eof - _test_eof167: - cs = 167 - goto _test_eof - _test_eof168: - cs = 168 - goto _test_eof - _test_eof169: - cs = 169 - goto _test_eof - _test_eof170: - cs = 170 - goto _test_eof - _test_eof171: - cs = 171 - goto _test_eof - _test_eof172: - cs = 172 - goto _test_eof - _test_eof173: - cs = 173 - goto _test_eof - _test_eof174: - cs = 174 - goto _test_eof - _test_eof175: - cs = 175 - goto _test_eof - _test_eof176: - cs = 176 - goto _test_eof - _test_eof177: - cs = 177 - goto _test_eof - _test_eof178: - cs = 178 - goto _test_eof - _test_eof179: - cs = 179 - goto _test_eof - _test_eof180: - cs = 180 - goto _test_eof - _test_eof181: - cs = 181 - goto _test_eof - _test_eof182: - cs = 182 - goto _test_eof - _test_eof183: - cs = 183 - goto _test_eof - _test_eof184: - cs = 184 - goto _test_eof - _test_eof185: - cs = 185 - goto _test_eof - _test_eof186: - cs = 186 - goto _test_eof - _test_eof187: - cs = 187 - goto _test_eof - _test_eof188: - cs = 188 - goto _test_eof - _test_eof189: - cs = 189 - goto _test_eof - _test_eof190: - cs = 190 - goto _test_eof - _test_eof191: - cs = 191 - goto _test_eof - _test_eof192: - cs = 192 - goto _test_eof - _test_eof193: - cs = 193 - goto _test_eof - _test_eof194: - cs = 194 - goto _test_eof - _test_eof195: - cs = 195 - goto _test_eof - _test_eof196: - cs = 196 - goto _test_eof - _test_eof197: - cs = 197 - goto _test_eof - _test_eof198: - cs = 198 - goto _test_eof - _test_eof199: - cs = 199 - goto _test_eof - _test_eof200: - cs = 200 - goto _test_eof - _test_eof201: - cs = 201 - goto _test_eof - _test_eof202: - cs = 202 - goto _test_eof - _test_eof203: - cs = 203 - goto _test_eof - _test_eof204: - cs = 204 - goto _test_eof - _test_eof205: - cs = 205 - goto _test_eof - _test_eof206: - cs = 206 - goto _test_eof - _test_eof207: - cs = 207 - goto _test_eof - _test_eof208: - cs = 208 - goto _test_eof - _test_eof209: - cs = 209 - goto _test_eof - _test_eof210: - cs = 210 - goto _test_eof - _test_eof211: - cs = 211 - goto _test_eof - _test_eof212: - cs = 212 - goto _test_eof - _test_eof213: - cs = 213 - goto _test_eof - _test_eof214: - cs = 214 - goto _test_eof - _test_eof215: - cs = 215 - goto _test_eof - _test_eof216: - cs = 216 - goto _test_eof - _test_eof217: - cs = 217 - goto _test_eof - _test_eof218: - cs = 218 - goto _test_eof - _test_eof219: - cs = 219 - goto _test_eof - _test_eof220: - cs = 220 - goto _test_eof - _test_eof221: - cs = 221 - goto _test_eof - _test_eof222: - cs = 222 - goto _test_eof - _test_eof223: - cs = 223 - goto _test_eof - _test_eof224: - cs = 224 - goto _test_eof - _test_eof225: - cs = 225 - goto _test_eof - _test_eof226: - cs = 226 - goto _test_eof - _test_eof227: - cs = 227 - goto _test_eof - _test_eof228: - cs = 228 - goto _test_eof - _test_eof229: - cs = 229 - goto _test_eof - _test_eof230: - cs = 230 - goto _test_eof - _test_eof231: - cs = 231 - goto _test_eof - _test_eof232: - cs = 232 - goto _test_eof - _test_eof233: - cs = 233 - goto _test_eof - _test_eof234: - cs = 234 - goto _test_eof - _test_eof235: - cs = 235 - goto _test_eof - _test_eof236: - cs = 236 - goto _test_eof - _test_eof237: - cs = 237 - goto _test_eof - _test_eof238: - cs = 238 - goto _test_eof - _test_eof239: - cs = 239 - goto _test_eof - _test_eof240: - cs = 240 - goto _test_eof - _test_eof241: - cs = 241 - goto _test_eof - _test_eof242: - cs = 242 - goto _test_eof - _test_eof243: - cs = 243 - goto _test_eof - _test_eof244: - cs = 244 - goto _test_eof - _test_eof245: - cs = 245 - goto _test_eof - _test_eof246: - cs = 246 - goto _test_eof - _test_eof247: - cs = 247 - goto _test_eof - _test_eof248: - cs = 248 - goto _test_eof - _test_eof249: - cs = 249 - goto _test_eof - _test_eof250: - cs = 250 - goto _test_eof - _test_eof251: - cs = 251 - goto _test_eof - _test_eof252: - cs = 252 - goto _test_eof - _test_eof253: - cs = 253 - goto _test_eof - _test_eof254: - cs = 254 - goto _test_eof - _test_eof255: - cs = 255 - goto _test_eof - _test_eof256: - cs = 256 - goto _test_eof - _test_eof257: - cs = 257 - goto _test_eof - _test_eof258: - cs = 258 - goto _test_eof - _test_eof259: - cs = 259 - goto _test_eof - _test_eof260: - cs = 260 - goto _test_eof - _test_eof261: - cs = 261 - goto _test_eof - _test_eof262: - cs = 262 - goto _test_eof - _test_eof263: - cs = 263 - goto _test_eof - _test_eof264: - cs = 264 - goto _test_eof - _test_eof265: - cs = 265 - goto _test_eof - _test_eof266: - cs = 266 - goto _test_eof - _test_eof267: - cs = 267 - goto _test_eof - _test_eof268: - cs = 268 - goto _test_eof - _test_eof269: - cs = 269 - goto _test_eof - _test_eof270: - cs = 270 - goto _test_eof - _test_eof271: - cs = 271 - goto _test_eof - _test_eof272: - cs = 272 - goto _test_eof - _test_eof273: - cs = 273 - goto _test_eof - _test_eof274: - cs = 274 - goto _test_eof - _test_eof275: - cs = 275 - goto _test_eof - _test_eof276: - cs = 276 - goto _test_eof - _test_eof277: - cs = 277 - goto _test_eof - _test_eof278: - cs = 278 - goto _test_eof - _test_eof279: - cs = 279 - goto _test_eof - _test_eof280: - cs = 280 - goto _test_eof - _test_eof281: - cs = 281 - goto _test_eof - _test_eof282: - cs = 282 - goto _test_eof - _test_eof283: - cs = 283 - goto _test_eof - _test_eof284: - cs = 284 - goto _test_eof - _test_eof285: - cs = 285 - goto _test_eof - _test_eof286: - cs = 286 - goto _test_eof - _test_eof287: - cs = 287 - goto _test_eof - _test_eof288: - cs = 288 - goto _test_eof - _test_eof289: - cs = 289 - goto _test_eof - _test_eof290: - cs = 290 - goto _test_eof - _test_eof291: - cs = 291 - goto _test_eof - _test_eof292: - cs = 292 - goto _test_eof - _test_eof293: - cs = 293 - goto _test_eof - _test_eof294: - cs = 294 - goto _test_eof - _test_eof295: - cs = 295 - goto _test_eof - _test_eof296: - cs = 296 - goto _test_eof - _test_eof297: - cs = 297 - goto _test_eof - _test_eof298: - cs = 298 - goto _test_eof - _test_eof299: - cs = 299 - goto _test_eof - _test_eof300: - cs = 300 - goto _test_eof - _test_eof301: - cs = 301 - goto _test_eof - _test_eof302: - cs = 302 - goto _test_eof - _test_eof303: - cs = 303 - goto _test_eof - _test_eof304: - cs = 304 - goto _test_eof - _test_eof305: - cs = 305 - goto _test_eof - _test_eof306: - cs = 306 - goto _test_eof - _test_eof307: - cs = 307 - goto _test_eof - _test_eof308: - cs = 308 - goto _test_eof - _test_eof309: - cs = 309 - goto _test_eof - _test_eof310: - cs = 310 - goto _test_eof - _test_eof311: - cs = 311 - goto _test_eof - _test_eof312: - cs = 312 - goto _test_eof - _test_eof313: - cs = 313 - goto _test_eof - _test_eof314: - cs = 314 - goto _test_eof - _test_eof315: - cs = 315 - goto _test_eof - _test_eof316: - cs = 316 - goto _test_eof - _test_eof317: - cs = 317 - goto _test_eof - _test_eof318: - cs = 318 - goto _test_eof - _test_eof319: - cs = 319 - goto _test_eof - _test_eof320: - cs = 320 - goto _test_eof - _test_eof321: - cs = 321 - goto _test_eof - _test_eof322: - cs = 322 - goto _test_eof - _test_eof323: - cs = 323 - goto _test_eof - _test_eof324: - cs = 324 - goto _test_eof - _test_eof325: - cs = 325 - goto _test_eof - _test_eof326: - cs = 326 - goto _test_eof - _test_eof327: - cs = 327 - goto _test_eof - _test_eof328: - cs = 328 - goto _test_eof - _test_eof329: - cs = 329 - goto _test_eof - _test_eof330: - cs = 330 - goto _test_eof - _test_eof331: - cs = 331 - goto _test_eof - _test_eof332: - cs = 332 - goto _test_eof - _test_eof333: - cs = 333 - goto _test_eof - _test_eof334: - cs = 334 - goto _test_eof - _test_eof335: - cs = 335 - goto _test_eof - _test_eof336: - cs = 336 - goto _test_eof - _test_eof337: - cs = 337 - goto _test_eof - _test_eof338: - cs = 338 - goto _test_eof - _test_eof339: - cs = 339 - goto _test_eof - _test_eof340: - cs = 340 - goto _test_eof - _test_eof341: - cs = 341 - goto _test_eof - _test_eof342: - cs = 342 - goto _test_eof - _test_eof343: - cs = 343 - goto _test_eof - _test_eof344: - cs = 344 - goto _test_eof - _test_eof345: - cs = 345 - goto _test_eof - _test_eof346: - cs = 346 - goto _test_eof - _test_eof347: - cs = 347 - goto _test_eof - _test_eof348: - cs = 348 - goto _test_eof - _test_eof349: - cs = 349 - goto _test_eof - _test_eof350: - cs = 350 - goto _test_eof - _test_eof351: - cs = 351 - goto _test_eof - _test_eof352: - cs = 352 - goto _test_eof - _test_eof353: - cs = 353 - goto _test_eof - _test_eof354: - cs = 354 - goto _test_eof - _test_eof355: - cs = 355 - goto _test_eof - _test_eof356: - cs = 356 - goto _test_eof - _test_eof357: - cs = 357 - goto _test_eof - _test_eof358: - cs = 358 - goto _test_eof - _test_eof359: - cs = 359 - goto _test_eof - _test_eof360: - cs = 360 - goto _test_eof - _test_eof361: - cs = 361 - goto _test_eof - _test_eof362: - cs = 362 - goto _test_eof - _test_eof363: - cs = 363 - goto _test_eof - _test_eof364: - cs = 364 - goto _test_eof - _test_eof365: - cs = 365 - goto _test_eof - _test_eof366: - cs = 366 - goto _test_eof - _test_eof367: - cs = 367 - goto _test_eof - _test_eof368: - cs = 368 - goto _test_eof - _test_eof369: - cs = 369 - goto _test_eof - _test_eof370: - cs = 370 - goto _test_eof - _test_eof371: - cs = 371 - goto _test_eof - _test_eof372: - cs = 372 - goto _test_eof - _test_eof373: - cs = 373 - goto _test_eof - _test_eof374: - cs = 374 - goto _test_eof - _test_eof375: - cs = 375 - goto _test_eof - _test_eof376: - cs = 376 - goto _test_eof - _test_eof377: - cs = 377 - goto _test_eof - _test_eof378: - cs = 378 - goto _test_eof - _test_eof379: - cs = 379 - goto _test_eof - _test_eof380: - cs = 380 - goto _test_eof - _test_eof381: - cs = 381 - goto _test_eof - _test_eof382: - cs = 382 - goto _test_eof - _test_eof383: - cs = 383 - goto _test_eof - _test_eof384: - cs = 384 - goto _test_eof - _test_eof385: - cs = 385 - goto _test_eof - _test_eof386: - cs = 386 - goto _test_eof - _test_eof387: - cs = 387 - goto _test_eof - _test_eof388: - cs = 388 - goto _test_eof - _test_eof389: - cs = 389 - goto _test_eof - _test_eof390: - cs = 390 - goto _test_eof - _test_eof391: - cs = 391 - goto _test_eof - _test_eof392: - cs = 392 - goto _test_eof - _test_eof393: - cs = 393 - goto _test_eof - _test_eof394: - cs = 394 - goto _test_eof - _test_eof395: - cs = 395 - goto _test_eof - _test_eof396: - cs = 396 - goto _test_eof - _test_eof397: - cs = 397 - goto _test_eof - _test_eof398: - cs = 398 - goto _test_eof - _test_eof399: - cs = 399 - goto _test_eof - _test_eof400: - cs = 400 - goto _test_eof - _test_eof401: - cs = 401 - goto _test_eof - _test_eof402: - cs = 402 - goto _test_eof - _test_eof403: - cs = 403 - goto _test_eof - _test_eof404: - cs = 404 - goto _test_eof - _test_eof405: - cs = 405 - goto _test_eof - _test_eof406: - cs = 406 - goto _test_eof - _test_eof407: - cs = 407 - goto _test_eof - _test_eof408: - cs = 408 - goto _test_eof - _test_eof409: - cs = 409 - goto _test_eof - _test_eof410: - cs = 410 - goto _test_eof - _test_eof411: - cs = 411 - goto _test_eof - _test_eof412: - cs = 412 - goto _test_eof - _test_eof413: - cs = 413 - goto _test_eof - _test_eof414: - cs = 414 - goto _test_eof - _test_eof415: - cs = 415 - goto _test_eof - _test_eof416: - cs = 416 - goto _test_eof - _test_eof417: - cs = 417 - goto _test_eof - _test_eof418: - cs = 418 - goto _test_eof - _test_eof419: - cs = 419 - goto _test_eof - _test_eof420: - cs = 420 - goto _test_eof - _test_eof421: - cs = 421 - goto _test_eof - _test_eof422: - cs = 422 - goto _test_eof - _test_eof423: - cs = 423 - goto _test_eof - _test_eof424: - cs = 424 - goto _test_eof - _test_eof425: - cs = 425 - goto _test_eof - _test_eof426: - cs = 426 - goto _test_eof - _test_eof427: - cs = 427 - goto _test_eof - _test_eof428: - cs = 428 - goto _test_eof - _test_eof429: - cs = 429 - goto _test_eof - _test_eof430: - cs = 430 - goto _test_eof - _test_eof431: - cs = 431 - goto _test_eof - _test_eof432: - cs = 432 - goto _test_eof - _test_eof433: - cs = 433 - goto _test_eof - _test_eof434: - cs = 434 - goto _test_eof - _test_eof435: - cs = 435 - goto _test_eof - _test_eof436: - cs = 436 - goto _test_eof - _test_eof437: - cs = 437 - goto _test_eof - _test_eof438: - cs = 438 - goto _test_eof - _test_eof439: - cs = 439 - goto _test_eof - _test_eof440: - cs = 440 - goto _test_eof - _test_eof441: - cs = 441 - goto _test_eof - _test_eof442: - cs = 442 - goto _test_eof - _test_eof443: - cs = 443 - goto _test_eof - _test_eof444: - cs = 444 - goto _test_eof - _test_eof445: - cs = 445 - goto _test_eof - _test_eof446: - cs = 446 - goto _test_eof - _test_eof447: - cs = 447 - goto _test_eof - _test_eof448: - cs = 448 - goto _test_eof - _test_eof449: - cs = 449 - goto _test_eof - _test_eof450: - cs = 450 - goto _test_eof - _test_eof451: - cs = 451 - goto _test_eof - _test_eof452: - cs = 452 - goto _test_eof - _test_eof453: - cs = 453 - goto _test_eof - _test_eof454: - cs = 454 - goto _test_eof - _test_eof455: - cs = 455 - goto _test_eof - _test_eof456: - cs = 456 - goto _test_eof - _test_eof457: - cs = 457 - goto _test_eof - _test_eof458: - cs = 458 - goto _test_eof - _test_eof459: - cs = 459 - goto _test_eof - _test_eof460: - cs = 460 - goto _test_eof - _test_eof461: - cs = 461 - goto _test_eof - _test_eof462: - cs = 462 - goto _test_eof - _test_eof463: - cs = 463 - goto _test_eof - _test_eof464: - cs = 464 - goto _test_eof - _test_eof465: - cs = 465 - goto _test_eof - _test_eof466: - cs = 466 - goto _test_eof - _test_eof467: - cs = 467 - goto _test_eof - _test_eof468: - cs = 468 - goto _test_eof - _test_eof469: - cs = 469 - goto _test_eof - _test_eof470: - cs = 470 - goto _test_eof - _test_eof471: - cs = 471 - goto _test_eof - _test_eof472: - cs = 472 - goto _test_eof - _test_eof473: - cs = 473 - goto _test_eof - _test_eof474: - cs = 474 - goto _test_eof - _test_eof475: - cs = 475 - goto _test_eof - _test_eof476: - cs = 476 - goto _test_eof - _test_eof477: - cs = 477 - goto _test_eof - _test_eof478: - cs = 478 - goto _test_eof - _test_eof479: - cs = 479 - goto _test_eof - _test_eof480: - cs = 480 - goto _test_eof - _test_eof481: - cs = 481 - goto _test_eof - _test_eof482: - cs = 482 - goto _test_eof - _test_eof483: - cs = 483 - goto _test_eof - _test_eof484: - cs = 484 - goto _test_eof - _test_eof485: - cs = 485 - goto _test_eof - _test_eof486: - cs = 486 - goto _test_eof - _test_eof487: - cs = 487 - goto _test_eof - _test_eof488: - cs = 488 - goto _test_eof - _test_eof489: - cs = 489 - goto _test_eof - _test_eof490: - cs = 490 - goto _test_eof - _test_eof491: - cs = 491 - goto _test_eof - _test_eof492: - cs = 492 - goto _test_eof - _test_eof493: - cs = 493 - goto _test_eof - _test_eof494: - cs = 494 - goto _test_eof - _test_eof495: - cs = 495 - goto _test_eof - _test_eof496: - cs = 496 - goto _test_eof - _test_eof497: - cs = 497 - goto _test_eof - _test_eof498: - cs = 498 - goto _test_eof - _test_eof499: - cs = 499 - goto _test_eof - _test_eof500: - cs = 500 - goto _test_eof - _test_eof501: - cs = 501 - goto _test_eof - _test_eof502: - cs = 502 - goto _test_eof - _test_eof503: - cs = 503 - goto _test_eof - _test_eof504: - cs = 504 - goto _test_eof - _test_eof505: - cs = 505 - goto _test_eof - _test_eof506: - cs = 506 - goto _test_eof - _test_eof507: - cs = 507 - goto _test_eof - _test_eof508: - cs = 508 - goto _test_eof - _test_eof509: - cs = 509 - goto _test_eof - _test_eof510: - cs = 510 - goto _test_eof - _test_eof511: - cs = 511 - goto _test_eof - _test_eof512: - cs = 512 - goto _test_eof - _test_eof513: - cs = 513 - goto _test_eof - _test_eof514: - cs = 514 - goto _test_eof - _test_eof515: - cs = 515 - goto _test_eof - _test_eof516: - cs = 516 - goto _test_eof - _test_eof517: - cs = 517 - goto _test_eof - _test_eof518: - cs = 518 - goto _test_eof - _test_eof519: - cs = 519 - goto _test_eof - _test_eof520: - cs = 520 - goto _test_eof - _test_eof521: - cs = 521 - goto _test_eof - _test_eof522: - cs = 522 - goto _test_eof - _test_eof523: - cs = 523 - goto _test_eof - _test_eof524: - cs = 524 - goto _test_eof - _test_eof525: - cs = 525 - goto _test_eof - _test_eof526: - cs = 526 - goto _test_eof - _test_eof527: - cs = 527 - goto _test_eof - _test_eof528: - cs = 528 - goto _test_eof - _test_eof529: - cs = 529 - goto _test_eof - _test_eof530: - cs = 530 - goto _test_eof - _test_eof531: - cs = 531 - goto _test_eof - _test_eof532: - cs = 532 - goto _test_eof - _test_eof533: - cs = 533 - goto _test_eof - _test_eof534: - cs = 534 - goto _test_eof - _test_eof535: - cs = 535 - goto _test_eof - _test_eof536: - cs = 536 - goto _test_eof - _test_eof537: - cs = 537 - goto _test_eof - _test_eof538: - cs = 538 - goto _test_eof - _test_eof539: - cs = 539 - goto _test_eof - _test_eof540: - cs = 540 - goto _test_eof - _test_eof541: - cs = 541 - goto _test_eof - _test_eof542: - cs = 542 - goto _test_eof - _test_eof543: - cs = 543 - goto _test_eof - _test_eof544: - cs = 544 - goto _test_eof - _test_eof545: - cs = 545 - goto _test_eof - _test_eof546: - cs = 546 - goto _test_eof - _test_eof547: - cs = 547 - goto _test_eof - _test_eof548: - cs = 548 - goto _test_eof - _test_eof549: - cs = 549 - goto _test_eof - _test_eof550: - cs = 550 - goto _test_eof - _test_eof551: - cs = 551 - goto _test_eof - _test_eof552: - cs = 552 - goto _test_eof - _test_eof553: - cs = 553 - goto _test_eof - _test_eof554: - cs = 554 - goto _test_eof - _test_eof555: - cs = 555 - goto _test_eof - _test_eof556: - cs = 556 - goto _test_eof - _test_eof557: - cs = 557 - goto _test_eof - _test_eof558: - cs = 558 - goto _test_eof - _test_eof559: - cs = 559 - goto _test_eof - _test_eof560: - cs = 560 - goto _test_eof - _test_eof561: - cs = 561 - goto _test_eof - _test_eof562: - cs = 562 - goto _test_eof - _test_eof563: - cs = 563 - goto _test_eof - _test_eof564: - cs = 564 - goto _test_eof - _test_eof565: - cs = 565 - goto _test_eof - _test_eof566: - cs = 566 - goto _test_eof - _test_eof567: - cs = 567 - goto _test_eof - _test_eof568: - cs = 568 - goto _test_eof - _test_eof569: - cs = 569 - goto _test_eof - _test_eof570: - cs = 570 - goto _test_eof - _test_eof571: - cs = 571 - goto _test_eof - _test_eof572: - cs = 572 - goto _test_eof - _test_eof573: - cs = 573 - goto _test_eof - _test_eof574: - cs = 574 - goto _test_eof - _test_eof575: - cs = 575 - goto _test_eof - _test_eof576: - cs = 576 - goto _test_eof - _test_eof577: - cs = 577 - goto _test_eof - _test_eof578: - cs = 578 - goto _test_eof - _test_eof579: - cs = 579 - goto _test_eof - _test_eof580: - cs = 580 - goto _test_eof - _test_eof581: - cs = 581 - goto _test_eof - _test_eof582: - cs = 582 - goto _test_eof - _test_eof583: - cs = 583 - goto _test_eof - _test_eof584: - cs = 584 - goto _test_eof - _test_eof585: - cs = 585 - goto _test_eof - _test_eof586: - cs = 586 - goto _test_eof - _test_eof587: - cs = 587 - goto _test_eof - _test_eof588: - cs = 588 - goto _test_eof - - _test_eof: - { + st_case_57: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st58 + case 93: + goto tr5 } - if p == eof { - switch cs { - case 591: -//line parser/common.rl:24 - - m.setMsg(data[tok:p]) - - case 1, 2, 3, 586, 587, 588: -//line parser/common.rl:36 - - err = ErrPriority - p-- - - case 6, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583: -//line parser/common.rl:41 - - err = ErrTimestamp - p-- - - case 8, 9, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546: -//line parser/common.rl:46 - - err = ErrHostname - p-- - - case 4: -//line parser/rfc5424.rl:53 - - err = ErrVersion - p-- - - case 10, 11, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292: -//line parser/rfc5424.rl:58 - - err = ErrAppName - p-- - - case 12, 13, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245: -//line parser/rfc5424.rl:63 - - err = ErrProcID - p-- - - case 14, 15, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118: -//line parser/rfc5424.rl:68 - - err = ErrMsgID - p-- - - case 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 56: -//line parser/rfc5424.rl:73 - - err = ErrStructuredData - p-- - - case 590: -//line parser/common.rl:4 - - tok = p - -//line parser/common.rl:24 - - m.setMsg(data[tok:p]) - - case 17, 18, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87: -//line parser/rfc5424.rl:78 - - err = ErrSDID - p-- - -//line parser/rfc5424.rl:73 - - err = ErrStructuredData - p-- - - case 54, 55: -//line parser/rfc5424.rl:83 - - err = ErrSDParam - p-- - -//line parser/rfc5424.rl:73 - - err = ErrStructuredData - p-- - -//line rfc5424_gen.go:9816 + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st58 } + case data[p] >= 35: + goto st58 } - - _out: - { - } - } - -//line parser/parser_rfc5424.rl:34 - - if err != nil { - return message{}, err - } - - return m, nil -} - -//line rfc5424_gen.go:9834 -const check_start int = 1 -const check_first_final int = 15 -const check_error int = 0 - -const check_en_main int = 1 - -//line parser/parser_rfc5424.rl:47 - -// isRFC5424 returns true if data is formatted as an RFC 5424 syslog message. -func isRFC5424(data string) bool { - var isRFC5424 bool - var p, cs int - - pe := len(data) - -//line rfc5424_gen.go:9853 - { - cs = check_start - } - -//line rfc5424_gen.go:9858 - { - if p == pe { - goto _test_eof + goto st0 + st58: + if p++; p == pe { + goto _test_eof58 } - switch cs { - case 1: - goto st_case_1 - case 0: - goto st_case_0 - case 2: - goto st_case_2 - case 3: - goto st_case_3 - case 4: - goto st_case_4 - case 5: - goto st_case_5 - case 6: - goto st_case_6 - case 7: - goto st_case_7 - case 8: - goto st_case_8 - case 9: - goto st_case_9 - case 15: - goto st_case_15 - case 10: - goto st_case_10 - case 11: - goto st_case_11 - case 12: - goto st_case_12 - case 13: - goto st_case_13 - case 14: - goto st_case_14 + st_case_58: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st59 + case 93: + goto tr5 } - goto st_out - st_case_1: - if data[p] == 60 { - goto st2 + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st59 + } + case data[p] >= 35: + goto st59 } goto st0 - st_case_0: - st0: - cs = 0 - goto _out - st2: + st59: if p++; p == pe { - goto _test_eof2 + goto _test_eof59 } - st_case_2: + st_case_59: switch data[p] { - case 48: - goto st3 - case 49: - goto st12 + case 32: + goto tr3 + case 33: + goto st60 + case 93: + goto tr5 } - if 50 <= data[p] && data[p] <= 57 { - goto st13 + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st60 + } + case data[p] >= 35: + goto st60 } goto st0 - st3: + st60: if p++; p == pe { - goto _test_eof3 + goto _test_eof60 } - st_case_3: - if data[p] == 62 { - goto st4 + st_case_60: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st61 + case 93: + goto tr5 + } + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st61 + } + case data[p] >= 35: + goto st61 } goto st0 - st4: + st61: if p++; p == pe { - goto _test_eof4 + goto _test_eof61 } - st_case_4: - if 49 <= data[p] && data[p] <= 57 { - goto st5 + st_case_61: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st62 + case 93: + goto tr5 + } + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st62 + } + case data[p] >= 35: + goto st62 } goto st0 - st5: + st62: if p++; p == pe { - goto _test_eof5 + goto _test_eof62 } - st_case_5: - if data[p] == 32 { - goto st6 + st_case_62: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st63 + case 93: + goto tr5 } - if 48 <= data[p] && data[p] <= 57 { - goto st10 + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st63 + } + case data[p] >= 35: + goto st63 } goto st0 - st6: + st63: if p++; p == pe { - goto _test_eof6 + goto _test_eof63 } - st_case_6: - if 48 <= data[p] && data[p] <= 57 { - goto tr9 + st_case_63: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st64 + case 93: + goto tr5 + } + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st64 + } + case data[p] >= 35: + goto st64 } goto st0 - tr9: -//line parser/parser_rfc5424.rl:57 - - isRFC5424 = true - - goto st7 - st7: + st64: if p++; p == pe { - goto _test_eof7 + goto _test_eof64 } - st_case_7: -//line rfc5424_gen.go:9972 - if 48 <= data[p] && data[p] <= 57 { - goto st8 + st_case_64: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st65 + case 93: + goto tr5 + } + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st65 + } + case data[p] >= 35: + goto st65 } goto st0 - st8: + st65: if p++; p == pe { - goto _test_eof8 + goto _test_eof65 } - st_case_8: - if 48 <= data[p] && data[p] <= 57 { - goto st9 + st_case_65: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st66 + case 93: + goto tr5 + } + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st66 + } + case data[p] >= 35: + goto st66 } goto st0 - st9: + st66: if p++; p == pe { - goto _test_eof9 + goto _test_eof66 } - st_case_9: - if 48 <= data[p] && data[p] <= 57 { - goto st15 + st_case_66: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st67 + case 93: + goto tr5 + } + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st67 + } + case data[p] >= 35: + goto st67 } goto st0 - st15: + st67: if p++; p == pe { - goto _test_eof15 + goto _test_eof67 + } + st_case_67: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st68 + case 93: + goto tr5 + } + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st68 + } + case data[p] >= 35: + goto st68 } - st_case_15: goto st0 - st10: + st68: if p++; p == pe { - goto _test_eof10 + goto _test_eof68 } - st_case_10: - if data[p] == 32 { - goto st6 + st_case_68: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st69 + case 93: + goto tr5 } - if 48 <= data[p] && data[p] <= 57 { - goto st11 + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st69 + } + case data[p] >= 35: + goto st69 } goto st0 - st11: + st69: if p++; p == pe { - goto _test_eof11 + goto _test_eof69 + } + st_case_69: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st70 + case 93: + goto tr5 } - st_case_11: - if data[p] == 32 { - goto st6 + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st70 + } + case data[p] >= 35: + goto st70 } goto st0 - st12: + st70: if p++; p == pe { - goto _test_eof12 + goto _test_eof70 } - st_case_12: + st_case_70: switch data[p] { - case 57: - goto st14 - case 62: - goto st4 + case 32: + goto tr3 + case 33: + goto st71 + case 93: + goto tr5 } - if 48 <= data[p] && data[p] <= 56 { - goto st13 + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st71 + } + case data[p] >= 35: + goto st71 } goto st0 - st13: + st71: if p++; p == pe { - goto _test_eof13 + goto _test_eof71 } - st_case_13: - if data[p] == 62 { - goto st4 + st_case_71: + switch data[p] { + case 32: + goto tr3 + case 33: + goto st72 + case 93: + goto tr5 } - if 48 <= data[p] && data[p] <= 57 { - goto st3 + switch { + case data[p] > 60: + if 62 <= data[p] && data[p] <= 126 { + goto st72 + } + case data[p] >= 35: + goto st72 } goto st0 - st14: + st72: if p++; p == pe { - goto _test_eof14 - } - st_case_14: - if data[p] == 62 { - goto st4 + goto _test_eof72 } - if 48 <= data[p] && data[p] <= 49 { - goto st3 + st_case_72: + switch data[p] { + case 32: + goto tr3 + case 93: + goto tr5 } goto st0 st_out: @@ -11251,9 +2692,6 @@ func isRFC5424(data string) bool { _test_eof9: cs = 9 goto _test_eof - _test_eof15: - cs = 15 - goto _test_eof _test_eof10: cs = 10 goto _test_eof @@ -11269,6 +2707,183 @@ func isRFC5424(data string) bool { _test_eof14: cs = 14 goto _test_eof + _test_eof15: + cs = 15 + goto _test_eof + _test_eof16: + cs = 16 + goto _test_eof + _test_eof17: + cs = 17 + goto _test_eof + _test_eof18: + cs = 18 + goto _test_eof + _test_eof19: + cs = 19 + goto _test_eof + _test_eof20: + cs = 20 + goto _test_eof + _test_eof21: + cs = 21 + goto _test_eof + _test_eof22: + cs = 22 + goto _test_eof + _test_eof23: + cs = 23 + goto _test_eof + _test_eof24: + cs = 24 + goto _test_eof + _test_eof25: + cs = 25 + goto _test_eof + _test_eof26: + cs = 26 + goto _test_eof + _test_eof27: + cs = 27 + goto _test_eof + _test_eof28: + cs = 28 + goto _test_eof + _test_eof29: + cs = 29 + goto _test_eof + _test_eof30: + cs = 30 + goto _test_eof + _test_eof31: + cs = 31 + goto _test_eof + _test_eof32: + cs = 32 + goto _test_eof + _test_eof33: + cs = 33 + goto _test_eof + _test_eof34: + cs = 34 + goto _test_eof + _test_eof35: + cs = 35 + goto _test_eof + _test_eof36: + cs = 36 + goto _test_eof + _test_eof37: + cs = 37 + goto _test_eof + _test_eof38: + cs = 38 + goto _test_eof + _test_eof39: + cs = 39 + goto _test_eof + _test_eof40: + cs = 40 + goto _test_eof + _test_eof73: + cs = 73 + goto _test_eof + _test_eof41: + cs = 41 + goto _test_eof + _test_eof42: + cs = 42 + goto _test_eof + _test_eof43: + cs = 43 + goto _test_eof + _test_eof44: + cs = 44 + goto _test_eof + _test_eof45: + cs = 45 + goto _test_eof + _test_eof46: + cs = 46 + goto _test_eof + _test_eof47: + cs = 47 + goto _test_eof + _test_eof48: + cs = 48 + goto _test_eof + _test_eof49: + cs = 49 + goto _test_eof + _test_eof50: + cs = 50 + goto _test_eof + _test_eof51: + cs = 51 + goto _test_eof + _test_eof52: + cs = 52 + goto _test_eof + _test_eof53: + cs = 53 + goto _test_eof + _test_eof54: + cs = 54 + goto _test_eof + _test_eof55: + cs = 55 + goto _test_eof + _test_eof56: + cs = 56 + goto _test_eof + _test_eof57: + cs = 57 + goto _test_eof + _test_eof58: + cs = 58 + goto _test_eof + _test_eof59: + cs = 59 + goto _test_eof + _test_eof60: + cs = 60 + goto _test_eof + _test_eof61: + cs = 61 + goto _test_eof + _test_eof62: + cs = 62 + goto _test_eof + _test_eof63: + cs = 63 + goto _test_eof + _test_eof64: + cs = 64 + goto _test_eof + _test_eof65: + cs = 65 + goto _test_eof + _test_eof66: + cs = 66 + goto _test_eof + _test_eof67: + cs = 67 + goto _test_eof + _test_eof68: + cs = 68 + goto _test_eof + _test_eof69: + cs = 69 + goto _test_eof + _test_eof70: + cs = 70 + goto _test_eof + _test_eof71: + cs = 71 + goto _test_eof + _test_eof72: + cs = 72 + goto _test_eof _test_eof: { @@ -11278,7 +2893,11 @@ func isRFC5424(data string) bool { } } -//line parser/parser_rfc5424.rl:68 +//line parser/parser_rfc5424.rl:102 - return isRFC5424 + if len(structuredData) == 0 { + return nil + } + + return structuredData } diff --git a/libbeat/reader/syslog/rfc5424_test.go b/libbeat/reader/syslog/rfc5424_test.go index 528335090f0a..b244d23abd4c 100644 --- a/libbeat/reader/syslog/rfc5424_test.go +++ b/libbeat/reader/syslog/rfc5424_test.go @@ -24,107 +24,164 @@ import ( "github.com/stretchr/testify/assert" ) -var parseRFC5424Cases = map[string]struct { - In string - Want message - WantErr bool -}{ - "example-1": { - In: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", - Want: message{ - timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), - priority: 13, - facility: 1, - severity: 5, - hostname: "test-host", - process: "su", - pid: "1234", - msg: "This is a test message", - msgID: "msg-5678", - version: 1, - }, - }, - "example-2": { - In: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 [sd-id-1 foo="bar"] This is a test message`, - Want: message{ - timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), - priority: 13, - facility: 1, - severity: 5, - hostname: "test-host", - process: "su", - pid: "1234", - msg: "This is a test message", - msgID: "msg-5678", - version: 1, - structuredData: map[string]map[string]string{ - "sd-id-1": { - "foo": "bar", - }, +func TestParseRFC5424(t *testing.T) { + tests := map[string]struct { + In string + Want message + WantErr string + }{ + "example-1": { + In: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + Want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + process: "su", + pid: "1234", + msg: "This is a test message", + msgID: "msg-5678", + version: 1, }, }, - }, - "example-3": { - In: `<13>1 - - - - - -`, - Want: message{ - priority: 13, - facility: 1, - severity: 5, - version: 1, - }, - }, - "example-4": { - In: `<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - ` + utf8BOM + `'su root' failed for user1 on /dev/pts/8`, - Want: message{ - timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), - priority: 34, - facility: 4, - severity: 2, - version: 1, - hostname: "mymachine.example.com", - process: "su", - msgID: "ID47", - msg: `'su root' failed for user1 on /dev/pts/8`, - }, - }, - "example-5": { - In: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, - Want: message{ - timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), - priority: 165, - facility: 20, - severity: 5, - version: 1, - hostname: "mymachine.example.com", - process: "evntslog", - msgID: "ID47", - structuredData: map[string]map[string]string{ - "exampleSDID@32473": { - "iut": "3", - "eventSource": "Application", - "eventID": "1011", - }, - "examplePriority@32473": { - "class": "high", - }, + "example-2": { + In: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 [sd-id-1 foo="bar"] This is a test message`, + Want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + process: "su", + pid: "1234", + msg: "This is a test message", + msgID: "msg-5678", + version: 1, + rawSDValue: `[sd-id-1 foo="bar"]`, }, }, - }, -} + "example-3": { + In: `<13>1 - - - - - -`, + Want: message{ + priority: 13, + facility: 1, + severity: 5, + version: 1, + }, + }, + "example-4": { + In: `<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - ` + utf8BOM + `'su root' failed for user1 on /dev/pts/8`, + Want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + priority: 34, + facility: 4, + severity: 2, + version: 1, + hostname: "mymachine.example.com", + process: "su", + msgID: "ID47", + msg: `'su root' failed for user1 on /dev/pts/8`, + }, + }, + "example-5": { + In: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + Want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + priority: 165, + facility: 20, + severity: 5, + version: 1, + hostname: "mymachine.example.com", + process: "evntslog", + msgID: "ID47", + rawSDValue: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + }, + }, + "non-compliant-sd": { + In: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + Want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + priority: 165, + facility: 20, + severity: 5, + version: 1, + hostname: "mymachine.example.com", + process: "evntslog", + msgID: "ID47", + rawSDValue: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + }, + }, + "non-compliant-sd-with-msg": { + In: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"] This is a test message`, + Want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + priority: 165, + facility: 20, + severity: 5, + version: 1, + hostname: "mymachine.example.com", + process: "evntslog", + msgID: "ID47", + rawSDValue: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + msg: "This is a test message", + }, + }, + "err-invalid-version": { + In: `<165>A 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + Want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + priority: 165, + facility: 20, + severity: 5, + hostname: "mymachine.example.com", + process: "evntslog", + msgID: "ID47", + rawSDValue: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + }, + WantErr: `validation error at position 6: invalid version: strconv.Atoi: parsing "A": invalid syntax`, + }, + "err-invalid-timestamp": { + In: `<165>1 10-11-2003T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + Want: message{ + priority: 165, + facility: 20, + severity: 5, + version: 1, + hostname: "mymachine.example.com", + process: "evntslog", + msgID: "ID47", + rawSDValue: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + }, + WantErr: `validation error at position 8: parsing time "10-11-2003T22:14:15.003Z" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "1-2003T22:14:15.003Z" as "2006"`, + }, + "err-eof": { + In: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-`, + Want: message{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), + priority: 13, + facility: 1, + severity: 5, + hostname: "test-host", + process: "su", + pid: "1234", + version: 1, + }, + WantErr: `parsing error at position 62: message is truncated (unexpected EOF)`, + }, + } -func TestParseRFC5424(t *testing.T) { - for name, tc := range parseRFC5424Cases { + for name, tc := range tests { tc := tc t.Run(name, func(t *testing.T) { t.Parallel() got, gotErr := parseRFC5424(tc.In) - if tc.WantErr { - assert.Error(t, gotErr) + if tc.WantErr != "" { + assert.ErrorContains(t, gotErr, tc.WantErr) } else { assert.NoError(t, gotErr) - assert.Equal(t, tc.Want, got) } assert.Equal(t, tc.Want, got) @@ -133,7 +190,27 @@ func TestParseRFC5424(t *testing.T) { } func BenchmarkParseRFC5424(b *testing.B) { - for name, bc := range parseRFC5424Cases { + tests := map[string]struct { + In string + }{ + "example-1": { + In: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + }, + "example-2": { + In: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 [sd-id-1 foo="bar"] This is a test message`, + }, + "example-3": { + In: `<13>1 - - - - - -`, + }, + "example-4": { + In: `<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - ` + utf8BOM + `'su root' failed for user1 on /dev/pts/8`, + }, + "example-5": { + In: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + }, + } + + for name, bc := range tests { bc := bc b.Run(name, func(b *testing.B) { b.ReportAllocs() @@ -144,45 +221,55 @@ func BenchmarkParseRFC5424(b *testing.B) { } } -var isRFC5424Cases = []struct { - In string - Want bool - Desc string -}{ - { - In: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", - Want: true, - Desc: "rfc-5424", - }, - { - In: "<13>Oct 11 22:14:15 test-host this is the message", - Want: false, - Desc: "rfc-3164", - }, - { - In: "not a valid message", - Want: false, - Desc: "invalid-message", - }, -} - func TestIsRFC5424(t *testing.T) { - for _, tc := range isRFC5424Cases { + tests := map[string]struct { + In string + Want bool + }{ + "rfc-5424": { + In: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + Want: true, + }, + "rfc-3164": { + In: "<13>Oct 11 22:14:15 test-host this is the message", + Want: false, + }, + "invalid-message": { + In: "not a valid message", + Want: false, + }, + } + + for name, tc := range tests { tc := tc - t.Run(tc.Desc, func(t *testing.T) { + t.Run(name, func(t *testing.T) { t.Parallel() got := isRFC5424(tc.In) - assert.Equal(t, tc.Want, got, tc.Desc) + assert.Equal(t, tc.Want, got) }) } } func BenchmarkIsRFC5424(b *testing.B) { - for _, bc := range isRFC5424Cases { + tests := map[string]struct { + In string + }{ + "rfc-5424": { + In: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + }, + "rfc-3164": { + In: "<13>Oct 11 22:14:15 test-host this is the message", + }, + "invalid-message": { + In: "not a valid message", + }, + } + + for name, bc := range tests { bc := bc - b.Run(bc.Desc, func(b *testing.B) { + b.Run(name, func(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { _ = isRFC5424(bc.In) diff --git a/libbeat/reader/syslog/syslog.go b/libbeat/reader/syslog/syslog.go index 6057a5d6f400..fe37cc2153d4 100644 --- a/libbeat/reader/syslog/syslog.go +++ b/libbeat/reader/syslog/syslog.go @@ -32,19 +32,48 @@ import ( //go:generate ragel -Z -G2 -o rfc5424_gen.go parser/parser_rfc5424.rl var ( - ErrPriority = errors.New("message has invalid or missing priority") - ErrTimestamp = errors.New("message has invalid or missing timestamp") - ErrHostname = errors.New("message has invalid or missing hostname") - ErrVersion = errors.New("message has invalid or missing version") - ErrAppName = errors.New("message has invalid or missing app name") - ErrProcID = errors.New("message has invalid or missing proc ID") - ErrMsgID = errors.New("message has invalid or missing msg ID") - ErrStructuredData = errors.New("message has invalid or missing structured data") - ErrSDID = errors.New("invalid structured data ID value, expected a value") - ErrSDIDDuplicated = errors.New("message contains duplicated structured data ID") - ErrSDParam = errors.New("invalid structured data parameter, expected a value") + // ErrPriority indicates a priority value is outside the acceptable range. + ErrPriority = errors.New("priority value out of range (expected 0..191)") + // ErrEOF indicates the message is truncated and cannot be parsed. + ErrEOF = errors.New("message is truncated (unexpected EOF)") ) +// ErrValidation represents data validation errors. +type ErrValidation struct { + // The underlying error. + Err error + // The position of the error. + Pos int +} + +// Error provides a descriptive error string. +func (e ErrValidation) Error() string { + return fmt.Sprintf("validation error at position %d: %v", e.Pos, e.Err) +} + +// Unwrap provides the underlying error. +func (e ErrValidation) Unwrap() error { + return e.Err +} + +// ErrParsing represents parsing errors. +type ErrParsing struct { + // The underlying error. + Err error + // The position of the error. + Pos int +} + +// Error provides a descriptive error string. +func (e ErrParsing) Error() string { + return fmt.Sprintf("parsing error at position %d: %v", e.Pos, e.Err) +} + +// Unwrap provides the underlying error. +func (e ErrParsing) Unwrap() error { + return e.Err +} + // Format defines syslog message formats. type Format int @@ -96,7 +125,8 @@ func DefaultConfig() Config { } // ParseMessage will parse syslog message data formatted as format into fields. loc is used to enrich -// timestamps that lack a time zone. +// timestamps that lack a time zone. The error value will indicate any errors encountered during parsing. +// Even if an error is returned, fields may still contain useful values. func ParseMessage(data string, format Format, loc *time.Location) (mapstr.M, time.Time, error) { var m message var err error @@ -113,11 +143,8 @@ func ParseMessage(data string, format Format, loc *time.Location) (mapstr.M, tim case FormatRFC5424: m, err = parseRFC5424(data) } - if err != nil { - return mapstr.M{}, time.Time{}, err - } - return m.fields(), m.timestamp, nil + return m.fields(), m.timestamp, err } // Parser is a syslog parser that implements parser.Parser. @@ -147,19 +174,19 @@ func (p *Parser) Next() (reader.Message, error) { if p.cfg.AddErrorKey { appendStringField(fields, "error.message", "Error parsing syslog message: "+err.Error()) } - msg.AddFields(fields) - return msg, nil } - textValue := fields["message"] - if textString, _ := textValue.(string); textString != "" { + if textString, _ := fields["message"].(string); textString != "" { msg.Content = []byte(textString) - } else { + msg.Bytes = len(msg.Content) + } else if err == nil { msg.Content = nil + msg.Bytes = 0 } - msg.Bytes = len(msg.Content) msg.AddFields(fields) - msg.Ts = ts + if !ts.IsZero() { + msg.Ts = ts + } return msg, nil } diff --git a/libbeat/reader/syslog/syslog_test.go b/libbeat/reader/syslog/syslog_test.go index 278a8ba1233b..039517611bdc 100644 --- a/libbeat/reader/syslog/syslog_test.go +++ b/libbeat/reader/syslog/syslog_test.go @@ -99,11 +99,11 @@ func TestNewParser(t *testing.T) { "procid": "1024", "msgid": "ID47", "version": "1", - "structured_data": map[string]map[string]string{ - "examplePriority@32473": { + "structured_data": map[string]interface{}{ + "examplePriority@32473": map[string]interface{}{ "class": "high", }, - "exampleSDID@32473": { + "exampleSDID@32473": map[string]interface{}{ "eventID": "1011", "eventSource": "Application", "iut": "3", diff --git a/libbeat/reader/syslog/util.go b/libbeat/reader/syslog/util.go index 5153d99aa97e..13a623fac19d 100644 --- a/libbeat/reader/syslog/util.go +++ b/libbeat/reader/syslog/util.go @@ -117,3 +117,19 @@ func appendStringField(m mapstr.M, field, value string) { _, _ = m.Put(field, append(t, value)) } } + +// joinStr joins strings a and b using separator sep. If a and b are empty, the +// result is an empty string. If a or b are empty, the other is returned. +func joinStr(a, b, sep string) string { + if a == "" && b == "" { + return "" + } + if a == "" { + return b + } + if b == "" { + return a + } + + return a + sep + b +} diff --git a/libbeat/reader/syslog/util_test.go b/libbeat/reader/syslog/util_test.go index d68a944c9d99..29849858e600 100644 --- a/libbeat/reader/syslog/util_test.go +++ b/libbeat/reader/syslog/util_test.go @@ -255,3 +255,48 @@ func TestAppendStringField(t *testing.T) { }) } } + +func TestJoinStr(t *testing.T) { + tests := map[string]struct { + InA string + InB string + InSep string + Want string + }{ + "both-empty": { + InA: "", + InB: "", + InSep: " ", + Want: "", + }, + "only-a": { + InA: "alpha", + InB: "", + InSep: " ", + Want: "alpha", + }, + "only-b": { + InA: "", + InB: "beta", + InSep: " ", + Want: "beta", + }, + "both": { + InA: "alpha", + InB: "beta", + InSep: " ", + Want: "alpha beta", + }, + } + + for name, tc := range tests { + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + + got := joinStr(tc.InA, tc.InB, tc.InSep) + + assert.Equal(t, tc.Want, got) + }) + } +} From 2c7af1a5067f12446e07484e6b98a122d29d2aec Mon Sep 17 00:00:00 2001 From: Taylor Swanson Date: Wed, 1 Jun 2022 09:22:58 -0500 Subject: [PATCH 2/9] Update changelog --- CHANGELOG.next.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 94819721cb1c..4c2b61f90841 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -38,6 +38,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff] *Affecting all Beats* - Allow loading secrets that contain commas from the keystore {pull}31694{pull}. +- Improve syslog parser/processor error handling. {issue}31246[31246] {pull}31798[31798] *Auditbeat* From d2b5bf54ecf9649a5b9b1b60f7c4c29f180f1d80 Mon Sep 17 00:00:00 2001 From: Taylor Swanson Date: Wed, 1 Jun 2022 09:54:27 -0500 Subject: [PATCH 3/9] Update notice --- NOTICE.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index 80ac4640e3c1..5bc7590fc66c 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -15098,11 +15098,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- Dependency : github.com/stretchr/testify -Version: v1.7.0 +Version: v1.7.1 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/stretchr/testify@v1.7.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/stretchr/testify@v1.7.1/LICENSE: MIT License From dfbb75c1e1d9592dd701dc99fcca8ca81de28840 Mon Sep 17 00:00:00 2001 From: Taylor Swanson Date: Wed, 1 Jun 2022 11:20:44 -0500 Subject: [PATCH 4/9] Fix tests --- libbeat/reader/syslog/message_test.go | 6 +++--- libbeat/reader/syslog/rfc5424_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libbeat/reader/syslog/message_test.go b/libbeat/reader/syslog/message_test.go index a997526355e7..c8514a960d75 100644 --- a/libbeat/reader/syslog/message_test.go +++ b/libbeat/reader/syslog/message_test.go @@ -420,7 +420,7 @@ func TestMessage_SetVersion(t *testing.T) { }, "empty": { In: "", - WantErr: "invalid version: strconv.Atoi: parsing \"\": invalid syntax", + WantErr: "invalid version, expected an integer: strconv.Atoi: parsing \"\"", }, } @@ -622,7 +622,7 @@ func TestMessage_Fields(t *testing.T) { "appname": "su", "procid": "1024", "msgid": "msg123", - "version": 1, + "version": "1", }, }, "message": `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, @@ -658,7 +658,7 @@ func TestMessage_Fields(t *testing.T) { "appname": "su", "procid": "1024", "msgid": "msg123", - "version": 1, + "version": "1", }, }, "message": `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"] This is a test message`, diff --git a/libbeat/reader/syslog/rfc5424_test.go b/libbeat/reader/syslog/rfc5424_test.go index b244d23abd4c..248151f163a7 100644 --- a/libbeat/reader/syslog/rfc5424_test.go +++ b/libbeat/reader/syslog/rfc5424_test.go @@ -139,7 +139,7 @@ func TestParseRFC5424(t *testing.T) { msgID: "ID47", rawSDValue: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, }, - WantErr: `validation error at position 6: invalid version: strconv.Atoi: parsing "A": invalid syntax`, + WantErr: `validation error at position 6: invalid version, expected an integer: strconv.Atoi: parsing "A": invalid syntax`, }, "err-invalid-timestamp": { In: `<165>1 10-11-2003T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, From d88309997f7429358d527f55bfa8ec2b5475b121 Mon Sep 17 00:00:00 2001 From: Taylor Swanson Date: Mon, 13 Jun 2022 09:17:00 -0500 Subject: [PATCH 5/9] Add docs about structured data --- libbeat/processors/syslog/docs/syslog.asciidoc | 8 ++++++++ libbeat/reader/syslog/docs/syslog.asciidoc | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/libbeat/processors/syslog/docs/syslog.asciidoc b/libbeat/processors/syslog/docs/syslog.asciidoc index 2e65eabdb60a..0cabf4f07f90 100644 --- a/libbeat/processors/syslog/docs/syslog.asciidoc +++ b/libbeat/processors/syslog/docs/syslog.asciidoc @@ -121,6 +121,14 @@ The RFC 5424 format accepts the following forms of timestamps: Formats with an asterisk (*) are a non-standard allowance. +[float] +==== Structured Data + +For RFC 5424-formatted logs, if the structured data cannot be parsed according +to RFC standards, the original structured data text will be prepended to the message +field, separated by a space. + + ifndef::serverless[] [float] diff --git a/libbeat/reader/syslog/docs/syslog.asciidoc b/libbeat/reader/syslog/docs/syslog.asciidoc index 85bf6a84d628..f8b430685216 100644 --- a/libbeat/reader/syslog/docs/syslog.asciidoc +++ b/libbeat/reader/syslog/docs/syslog.asciidoc @@ -69,3 +69,10 @@ The RFC 5424 format accepts the following forms of timestamps: ** `2003-10-11T22:14:15.123456-06:00` Formats with an asterisk (*) are a non-standard allowance. + +[float] +==== Structured Data + +For RFC 5424-formatted logs, if the structured data cannot be parsed according +to RFC standards, the original structured data text will be prepended to the message +field, separated by a space. From b6397c047fef22bd86f6574655c50162689f0604 Mon Sep 17 00:00:00 2001 From: Taylor Swanson Date: Tue, 14 Jun 2022 10:06:55 -0500 Subject: [PATCH 6/9] Remove line directives from ragel generated files --- libbeat/reader/syslog/rfc3164_gen.go | 44 -------------- libbeat/reader/syslog/rfc5424_gen.go | 91 +--------------------------- libbeat/reader/syslog/syslog.go | 6 ++ 3 files changed, 7 insertions(+), 134 deletions(-) diff --git a/libbeat/reader/syslog/rfc3164_gen.go b/libbeat/reader/syslog/rfc3164_gen.go index c6e756bc221a..1d62b59b067e 100644 --- a/libbeat/reader/syslog/rfc3164_gen.go +++ b/libbeat/reader/syslog/rfc3164_gen.go @@ -15,7 +15,6 @@ // specific language governing permissions and limitations // under the License. -//line parser/parser_rfc3164.rl:1 // Code generated by ragel. DO NOT EDIT. package syslog @@ -25,14 +24,12 @@ import ( "go.uber.org/multierr" ) -//line rfc3164_gen.go:14 const rfc3164_parser_start int = 1 const rfc3164_parser_first_final int = 24 const rfc3164_parser_error int = 0 const rfc3164_parser_en_main int = 1 -//line parser/parser_rfc3164.rl:14 // parseRFC3164 parses an RFC 3164-formatted syslog message. loc is used to enrich // timestamps that lack a time zone. @@ -46,12 +43,10 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { priority: -1, } -//line rfc3164_gen.go:38 { cs = rfc3164_parser_start } -//line rfc3164_gen.go:43 { if p == pe { goto _test_eof @@ -143,19 +138,16 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto tr0 tr0: -//line parser/common.rl:42 errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) p-- goto st0 -//line rfc3164_gen.go:142 st_case_0: st0: cs = 0 goto _out tr1: -//line parser/common.rl:4 tok = p @@ -165,7 +157,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof2 } st_case_2: -//line rfc3164_gen.go:158 switch data[p] { case 43: goto st3 @@ -203,7 +194,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto tr0 tr6: -//line parser/common.rl:14 if err := m.setTimestampRFC3339(data[tok:p]); err != nil { errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) @@ -211,7 +201,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto st4 tr30: -//line parser/common.rl:20 if err := m.setTimestampBSD(data[tok:p], loc); err != nil { errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) @@ -223,13 +212,11 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof4 } st_case_4: -//line rfc3164_gen.go:216 if 33 <= data[p] && data[p] <= 126 { goto tr8 } goto tr0 tr8: -//line parser/common.rl:4 tok = p @@ -239,7 +226,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof5 } st_case_5: -//line rfc3164_gen.go:232 if data[p] == 32 { goto tr9 } @@ -248,7 +234,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto tr0 tr9: -//line parser/common.rl:26 m.setHostname(data[tok:p]) @@ -258,7 +243,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof6 } st_case_6: -//line rfc3164_gen.go:251 switch { case data[p] < 59: if 33 <= data[p] && data[p] <= 57 { @@ -273,7 +257,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto tr11 tr11: -//line parser/common.rl:4 tok = p @@ -283,10 +266,8 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof24 } st_case_24: -//line rfc3164_gen.go:276 goto st24 tr12: -//line parser/common.rl:4 tok = p @@ -296,7 +277,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof25 } st_case_25: -//line rfc3164_gen.go:289 switch data[p] { case 58: goto tr34 @@ -308,7 +288,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto st24 tr34: -//line parser/rfc3164.rl:7 m.setTag(data[tok:p]) @@ -318,7 +297,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof26 } st_case_26: -//line rfc3164_gen.go:311 if data[p] == 32 { goto st27 } @@ -330,7 +308,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { st_case_27: goto tr11 tr35: -//line parser/rfc3164.rl:7 m.setTag(data[tok:p]) @@ -340,13 +317,11 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof28 } st_case_28: -//line rfc3164_gen.go:333 if 32 <= data[p] && data[p] <= 126 { goto tr37 } goto st24 tr37: -//line parser/common.rl:4 tok = p @@ -356,7 +331,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof29 } st_case_29: -//line rfc3164_gen.go:349 if data[p] == 93 { goto tr39 } @@ -365,17 +339,14 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto st24 tr39: -//line parser/rfc3164.rl:11 m.setContent(data[tok:p]) goto st30 tr42: -//line parser/rfc3164.rl:11 m.setContent(data[tok:p]) -//line parser/common.rl:4 tok = p @@ -385,7 +356,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof30 } st_case_30: -//line rfc3164_gen.go:378 switch data[p] { case 58: goto st31 @@ -464,7 +434,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto tr0 tr13: -//line parser/common.rl:4 tok = p @@ -474,7 +443,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof9 } st_case_9: -//line rfc3164_gen.go:467 if data[p] == 62 { goto tr15 } @@ -483,7 +451,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto tr0 tr15: -//line parser/common.rl:8 if err := m.setPriority(data[tok:p]); err != nil { errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) @@ -495,7 +462,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof10 } st_case_10: -//line rfc3164_gen.go:488 if data[p] == 62 { goto tr15 } @@ -531,7 +497,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto tr0 tr16: -//line parser/common.rl:4 tok = p @@ -541,7 +506,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof11 } st_case_11: -//line rfc3164_gen.go:534 switch data[p] { case 43: goto st12 @@ -666,7 +630,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto tr0 tr17: -//line parser/common.rl:4 tok = p @@ -676,7 +639,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof14 } st_case_14: -//line rfc3164_gen.go:669 switch data[p] { case 32: goto st15 @@ -797,7 +759,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } goto tr0 tr3: -//line parser/common.rl:4 tok = p @@ -807,7 +768,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto _test_eof23 } st_case_23: -//line rfc3164_gen.go:800 if data[p] == 32 { goto st15 } @@ -921,17 +881,14 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { if p == eof { switch cs { case 24, 25, 26, 27, 28, 29, 30, 31, 32: -//line parser/common.rl:30 m.setMsg(data[tok:p]) case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23: -//line parser/common.rl:42 errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) p-- -//line rfc3164_gen.go:861 } } @@ -940,7 +897,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } } -//line parser/parser_rfc3164.rl:36 return m, errs } diff --git a/libbeat/reader/syslog/rfc5424_gen.go b/libbeat/reader/syslog/rfc5424_gen.go index e38f84859723..0a0b2f1affeb 100644 --- a/libbeat/reader/syslog/rfc5424_gen.go +++ b/libbeat/reader/syslog/rfc5424_gen.go @@ -15,20 +15,17 @@ // specific language governing permissions and limitations // under the License. -//line parser/parser_rfc5424.rl:1 // Code generated by ragel. DO NOT EDIT. package syslog import "go.uber.org/multierr" -//line rfc5424_gen.go:10 const rfc5424_start int = 1 const rfc5424_first_final int = 23 const rfc5424_error int = 0 const rfc5424_en_main int = 1 -//line parser/parser_rfc5424.rl:10 type machineState struct { sdID string @@ -47,12 +44,10 @@ func parseRFC5424(data string) (message, error) { priority: -1, } -//line rfc5424_gen.go:39 { cs = rfc5424_start } -//line rfc5424_gen.go:44 { if p == pe { goto _test_eof @@ -126,13 +121,11 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr0: -//line parser/common.rl:42 errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) p-- goto st0 -//line rfc5424_gen.go:125 st_case_0: st0: cs = 0 @@ -147,7 +140,6 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr2: -//line parser/common.rl:4 tok = p @@ -157,7 +149,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof3 } st_case_3: -//line rfc5424_gen.go:150 if data[p] == 62 { goto tr4 } @@ -166,7 +157,6 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr4: -//line parser/common.rl:8 if err := m.setPriority(data[tok:p]); err != nil { errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) @@ -178,7 +168,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof4 } st_case_4: -//line rfc5424_gen.go:171 if data[p] == 62 { goto tr6 } @@ -187,7 +176,6 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr5: -//line parser/common.rl:4 tok = p @@ -197,7 +185,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof5 } st_case_5: -//line rfc5424_gen.go:190 switch data[p] { case 32: goto tr7 @@ -209,7 +196,6 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr7: -//line parser/rfc5424.rl:19 if err := m.setVersion(data[tok:p]); err != nil { errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) @@ -221,7 +207,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof6 } st_case_6: -//line rfc5424_gen.go:214 if data[p] == 45 { goto st7 } @@ -239,7 +224,6 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr31: -//line parser/common.rl:14 if err := m.setTimestampRFC3339(data[tok:p]); err != nil { errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) @@ -251,13 +235,11 @@ func parseRFC5424(data string) (message, error) { goto _test_eof8 } st_case_8: -//line rfc5424_gen.go:244 if 33 <= data[p] && data[p] <= 126 { goto tr13 } goto tr0 tr13: -//line parser/common.rl:4 tok = p @@ -267,7 +249,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof9 } st_case_9: -//line rfc5424_gen.go:260 if data[p] == 32 { goto tr14 } @@ -276,7 +257,6 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr14: -//line parser/common.rl:26 m.setHostname(data[tok:p]) @@ -286,13 +266,11 @@ func parseRFC5424(data string) (message, error) { goto _test_eof10 } st_case_10: -//line rfc5424_gen.go:279 if 33 <= data[p] && data[p] <= 126 { goto tr16 } goto tr0 tr16: -//line parser/common.rl:4 tok = p @@ -302,7 +280,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof11 } st_case_11: -//line rfc5424_gen.go:295 if data[p] == 32 { goto tr17 } @@ -311,7 +288,6 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr17: -//line parser/rfc5424.rl:11 m.setAppName(data[tok:p]) @@ -321,13 +297,11 @@ func parseRFC5424(data string) (message, error) { goto _test_eof12 } st_case_12: -//line rfc5424_gen.go:314 if 33 <= data[p] && data[p] <= 126 { goto tr19 } goto tr0 tr19: -//line parser/common.rl:4 tok = p @@ -337,7 +311,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof13 } st_case_13: -//line rfc5424_gen.go:330 if data[p] == 32 { goto tr20 } @@ -346,7 +319,6 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr20: -//line parser/rfc5424.rl:7 m.setProcID(data[tok:p]) @@ -356,13 +328,11 @@ func parseRFC5424(data string) (message, error) { goto _test_eof14 } st_case_14: -//line rfc5424_gen.go:349 if 33 <= data[p] && data[p] <= 126 { goto tr22 } goto tr0 tr22: -//line parser/common.rl:4 tok = p @@ -372,7 +342,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof15 } st_case_15: -//line rfc5424_gen.go:365 if data[p] == 32 { goto tr23 } @@ -381,7 +350,6 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr23: -//line parser/rfc5424.rl:15 m.setMsgID(data[tok:p]) @@ -391,7 +359,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof16 } st_case_16: -//line rfc5424_gen.go:384 switch data[p] { case 45: goto st23 @@ -415,7 +382,6 @@ func parseRFC5424(data string) (message, error) { st_case_24: goto tr34 tr34: -//line parser/common.rl:4 tok = p @@ -425,10 +391,8 @@ func parseRFC5424(data string) (message, error) { goto _test_eof25 } st_case_25: -//line rfc5424_gen.go:418 goto st25 tr26: -//line parser/common.rl:4 tok = p @@ -438,7 +402,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof17 } st_case_17: -//line rfc5424_gen.go:431 goto st18 st18: if p++; p == pe { @@ -462,7 +425,6 @@ func parseRFC5424(data string) (message, error) { } goto st18 tr36: -//line parser/rfc5424.rl:25 m.setRawSDValue(data[tok:p]) @@ -472,13 +434,11 @@ func parseRFC5424(data string) (message, error) { goto _test_eof27 } st_case_27: -//line rfc5424_gen.go:465 if data[p] == 93 { goto tr38 } goto tr37 tr37: -//line parser/common.rl:4 tok = p @@ -488,13 +448,11 @@ func parseRFC5424(data string) (message, error) { goto _test_eof28 } st_case_28: -//line rfc5424_gen.go:481 if data[p] == 93 { goto st29 } goto st28 tr38: -//line parser/common.rl:4 tok = p @@ -504,7 +462,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof29 } st_case_29: -//line rfc5424_gen.go:497 switch data[p] { case 32: goto tr36 @@ -513,7 +470,6 @@ func parseRFC5424(data string) (message, error) { } goto st28 tr11: -//line parser/common.rl:4 tok = p @@ -523,7 +479,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof19 } st_case_19: -//line rfc5424_gen.go:516 switch data[p] { case 43: goto st20 @@ -592,7 +547,6 @@ func parseRFC5424(data string) (message, error) { } goto tr0 tr9: -//line parser/common.rl:8 if err := m.setPriority(data[tok:p]); err != nil { errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) @@ -600,13 +554,11 @@ func parseRFC5424(data string) (message, error) { goto st22 tr6: -//line parser/common.rl:8 if err := m.setPriority(data[tok:p]); err != nil { errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) } -//line parser/common.rl:4 tok = p @@ -616,7 +568,6 @@ func parseRFC5424(data string) (message, error) { goto _test_eof22 } st_case_22: -//line rfc5424_gen.go:609 switch data[p] { case 32: goto tr7 @@ -719,40 +670,32 @@ func parseRFC5424(data string) (message, error) { if p == eof { switch cs { case 25, 28: -//line parser/common.rl:30 m.setMsg(data[tok:p]) case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22: -//line parser/common.rl:42 errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) p-- case 26: -//line parser/rfc5424.rl:25 m.setRawSDValue(data[tok:p]) case 24, 27: -//line parser/common.rl:4 tok = p -//line parser/common.rl:30 m.setMsg(data[tok:p]) case 29: -//line parser/rfc5424.rl:25 m.setRawSDValue(data[tok:p]) -//line parser/common.rl:30 m.setMsg(data[tok:p]) -//line rfc5424_gen.go:688 } } @@ -761,19 +704,16 @@ func parseRFC5424(data string) (message, error) { } } -//line parser/parser_rfc5424.rl:37 return m, errs } -//line rfc5424_gen.go:702 const check_start int = 1 const check_first_final int = 10 const check_error int = 0 const check_en_main int = 1 -//line parser/parser_rfc5424.rl:46 // isRFC5424 returns true if data is formatted as an RFC 5424 syslog message. func isRFC5424(data string) bool { @@ -782,12 +722,10 @@ func isRFC5424(data string) bool { pe := len(data) -//line rfc5424_gen.go:721 { cs = check_start } -//line rfc5424_gen.go:726 { if p == pe { goto _test_eof @@ -878,7 +816,6 @@ func isRFC5424(data string) bool { } goto st0 tr6: -//line parser/parser_rfc5424.rl:56 isRFC5424 = true @@ -888,7 +825,6 @@ func isRFC5424(data string) bool { goto _test_eof7 } st_case_7: -//line rfc5424_gen.go:827 if 48 <= data[p] && data[p] <= 57 { goto st8 } @@ -954,21 +890,18 @@ func isRFC5424(data string) bool { } } -//line parser/parser_rfc5424.rl:67 return isRFC5424 } -//line rfc5424_gen.go:878 const parse_sd_start int = 1 const parse_sd_first_final int = 73 const parse_sd_error int = 0 const parse_sd_en_main int = 1 -//line parser/parser_rfc5424.rl:76 -// structuredData performs a best effort parsing of the raw structured data value +// parseStructuredData performs a best effort parsing of the raw structured data value // extracted from the syslog message. If the raw structured data value is an empty // string or the nil value ('-'), nil is returned. Otherwise, the value is parsed // using the format defined by RFC 5424. If the value cannot be parsed, then nil @@ -984,12 +917,10 @@ func parseStructuredData(data string) map[string]interface{} { return nil } -//line rfc5424_gen.go:906 { cs = parse_sd_start } -//line rfc5424_gen.go:911 { if p == pe { goto _test_eof @@ -1176,7 +1107,6 @@ func parseStructuredData(data string) map[string]interface{} { } goto st0 tr2: -//line parser/common.rl:4 tok = p @@ -1186,7 +1116,6 @@ func parseStructuredData(data string) map[string]interface{} { goto _test_eof3 } st_case_3: -//line rfc5424_gen.go:1108 switch data[p] { case 32: goto tr3 @@ -1205,7 +1134,6 @@ func parseStructuredData(data string) map[string]interface{} { } goto st0 tr3: -//line parser/rfc5424.rl:43 s.sdID = data[tok:p] if _, ok := structuredData[s.sdID]; !ok { @@ -1218,7 +1146,6 @@ func parseStructuredData(data string) map[string]interface{} { goto _test_eof4 } st_case_4: -//line rfc5424_gen.go:1140 if data[p] == 33 { goto tr6 } @@ -1236,7 +1163,6 @@ func parseStructuredData(data string) map[string]interface{} { } goto st0 tr6: -//line parser/common.rl:4 tok = p @@ -1246,7 +1172,6 @@ func parseStructuredData(data string) map[string]interface{} { goto _test_eof5 } st_case_5: -//line rfc5424_gen.go:1168 switch data[p] { case 33: goto st6 @@ -1872,7 +1797,6 @@ func parseStructuredData(data string) map[string]interface{} { } goto st0 tr8: -//line parser/rfc5424.rl:33 s.sdParamName = data[tok:p] @@ -1882,7 +1806,6 @@ func parseStructuredData(data string) map[string]interface{} { goto _test_eof37 } st_case_37: -//line rfc5424_gen.go:1804 if data[p] == 34 { goto st38 } @@ -1902,7 +1825,6 @@ func parseStructuredData(data string) map[string]interface{} { } goto tr40 tr40: -//line parser/common.rl:4 tok = p @@ -1912,7 +1834,6 @@ func parseStructuredData(data string) map[string]interface{} { goto _test_eof39 } st_case_39: -//line rfc5424_gen.go:1834 switch data[p] { case 34: goto tr43 @@ -1923,13 +1844,11 @@ func parseStructuredData(data string) map[string]interface{} { } goto st39 tr43: -//line parser/rfc5424.rl:37 if subMap, ok := structuredData[s.sdID].(map[string]interface{}); ok { subMap[s.sdParamName] = removeBytes(data[tok:p], s.sdValueEscapes, p) } -//line parser/rfc5424.rl:29 s.sdValueEscapes = nil @@ -1939,7 +1858,6 @@ func parseStructuredData(data string) map[string]interface{} { goto _test_eof40 } st_case_40: -//line rfc5424_gen.go:1861 switch data[p] { case 32: goto st4 @@ -1948,7 +1866,6 @@ func parseStructuredData(data string) map[string]interface{} { } goto st0 tr5: -//line parser/rfc5424.rl:43 s.sdID = data[tok:p] if _, ok := structuredData[s.sdID]; !ok { @@ -1961,23 +1878,19 @@ func parseStructuredData(data string) map[string]interface{} { goto _test_eof73 } st_case_73: -//line rfc5424_gen.go:1883 if data[p] == 91 { goto st2 } goto st0 tr41: -//line parser/common.rl:4 tok = p -//line parser/rfc5424.rl:50 s.sdValueEscapes = append(s.sdValueEscapes, p) goto st41 tr44: -//line parser/rfc5424.rl:50 s.sdValueEscapes = append(s.sdValueEscapes, p) @@ -1987,7 +1900,6 @@ func parseStructuredData(data string) map[string]interface{} { goto _test_eof41 } st_case_41: -//line rfc5424_gen.go:1909 if data[p] == 34 { goto st39 } @@ -2893,7 +2805,6 @@ func parseStructuredData(data string) map[string]interface{} { } } -//line parser/parser_rfc5424.rl:102 if len(structuredData) == 0 { return nil diff --git a/libbeat/reader/syslog/syslog.go b/libbeat/reader/syslog/syslog.go index fe37cc2153d4..5bbeaa8c13b7 100644 --- a/libbeat/reader/syslog/syslog.go +++ b/libbeat/reader/syslog/syslog.go @@ -28,6 +28,12 @@ import ( "github.com/elastic/elastic-agent-libs/mapstr" ) +// Note: When re-generating these files, it may be necessary to remove the +// //line: directives from the *_gen.go files. Otherwise, code coverage +// may fail to build due to an error similar to: +// +// cover: inconsistent NumStmt: changed from 2 to 1 +// //go:generate ragel -Z -G2 -o rfc3164_gen.go parser/parser_rfc3164.rl //go:generate ragel -Z -G2 -o rfc5424_gen.go parser/parser_rfc5424.rl From 25119b92ef676e1a5832915f52f607275f016df7 Mon Sep 17 00:00:00 2001 From: Taylor Swanson Date: Tue, 14 Jun 2022 11:00:55 -0500 Subject: [PATCH 7/9] formatting --- libbeat/reader/syslog/rfc3164_gen.go | 3 --- libbeat/reader/syslog/rfc5424_gen.go | 11 ----------- 2 files changed, 14 deletions(-) diff --git a/libbeat/reader/syslog/rfc3164_gen.go b/libbeat/reader/syslog/rfc3164_gen.go index 1d62b59b067e..544fb0c921bb 100644 --- a/libbeat/reader/syslog/rfc3164_gen.go +++ b/libbeat/reader/syslog/rfc3164_gen.go @@ -30,7 +30,6 @@ const rfc3164_parser_error int = 0 const rfc3164_parser_en_main int = 1 - // parseRFC3164 parses an RFC 3164-formatted syslog message. loc is used to enrich // timestamps that lack a time zone. func parseRFC3164(data string, loc *time.Location) (message, error) { @@ -347,7 +346,6 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { m.setContent(data[tok:p]) - tok = p goto st30 @@ -897,6 +895,5 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { } } - return m, errs } diff --git a/libbeat/reader/syslog/rfc5424_gen.go b/libbeat/reader/syslog/rfc5424_gen.go index 0a0b2f1affeb..74c84192490f 100644 --- a/libbeat/reader/syslog/rfc5424_gen.go +++ b/libbeat/reader/syslog/rfc5424_gen.go @@ -26,7 +26,6 @@ const rfc5424_error int = 0 const rfc5424_en_main int = 1 - type machineState struct { sdID string sdParamName string @@ -559,7 +558,6 @@ func parseRFC5424(data string) (message, error) { errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) } - tok = p goto st22 @@ -686,14 +684,12 @@ func parseRFC5424(data string) (message, error) { tok = p - m.setMsg(data[tok:p]) case 29: m.setRawSDValue(data[tok:p]) - m.setMsg(data[tok:p]) } @@ -704,7 +700,6 @@ func parseRFC5424(data string) (message, error) { } } - return m, errs } @@ -714,7 +709,6 @@ const check_error int = 0 const check_en_main int = 1 - // isRFC5424 returns true if data is formatted as an RFC 5424 syslog message. func isRFC5424(data string) bool { var isRFC5424 bool @@ -890,7 +884,6 @@ func isRFC5424(data string) bool { } } - return isRFC5424 } @@ -900,7 +893,6 @@ const parse_sd_error int = 0 const parse_sd_en_main int = 1 - // parseStructuredData performs a best effort parsing of the raw structured data value // extracted from the syslog message. If the raw structured data value is an empty // string or the nil value ('-'), nil is returned. Otherwise, the value is parsed @@ -1849,7 +1841,6 @@ func parseStructuredData(data string) map[string]interface{} { subMap[s.sdParamName] = removeBytes(data[tok:p], s.sdValueEscapes, p) } - s.sdValueEscapes = nil goto st40 @@ -1886,7 +1877,6 @@ func parseStructuredData(data string) map[string]interface{} { tok = p - s.sdValueEscapes = append(s.sdValueEscapes, p) goto st41 @@ -2805,7 +2795,6 @@ func parseStructuredData(data string) map[string]interface{} { } } - if len(structuredData) == 0 { return nil } From 3f435d64b50f0f696d8007aab07f6baf58319143 Mon Sep 17 00:00:00 2001 From: Taylor Swanson Date: Wed, 15 Jun 2022 08:40:11 -0500 Subject: [PATCH 8/9] Improve tests - Add explicit wants to test cases - Un-export test input fields - Add checks for errors in timestamp tests --- libbeat/processors/syslog/syslog_test.go | 82 +++--- libbeat/reader/syslog/message_test.go | 346 ++++++++++++----------- libbeat/reader/syslog/rfc3164_test.go | 110 +++---- libbeat/reader/syslog/rfc5424_test.go | 104 +++---- libbeat/reader/syslog/syslog_test.go | 60 ++-- libbeat/reader/syslog/util_test.go | 234 +++++++-------- 6 files changed, 477 insertions(+), 459 deletions(-) diff --git a/libbeat/processors/syslog/syslog_test.go b/libbeat/processors/syslog/syslog_test.go index 34f3c392bfa2..af530b8d00ae 100644 --- a/libbeat/processors/syslog/syslog_test.go +++ b/libbeat/processors/syslog/syslog_test.go @@ -57,20 +57,20 @@ func mustParseTime(layout, value string, loc *time.Location) time.Time { } var syslogCases = map[string]struct { - Cfg *conf.C - In mapstr.M - Want mapstr.M - WantTime time.Time - WantErr bool + cfg *conf.C + in mapstr.M + want mapstr.M + wantTime time.Time + wantErr bool }{ "rfc-3164": { - Cfg: conf.MustNewConfigFrom(mapstr.M{ + cfg: conf.MustNewConfigFrom(mapstr.M{ "timezone": "America/Chicago", }), - In: mapstr.M{ + in: mapstr.M{ "message": `<13>Oct 11 22:14:15 test-host su[1024]: this is the message`, }, - Want: mapstr.M{ + want: mapstr.M{ "log": mapstr.M{ "syslog": mapstr.M{ "priority": 13, @@ -89,14 +89,14 @@ var syslogCases = map[string]struct { }, "message": "this is the message", }, - WantTime: mustParseTime(time.Stamp, "Oct 11 22:14:15", cfgtype.MustNewTimezone("America/Chicago").Location()), + wantTime: mustParseTime(time.Stamp, "Oct 11 22:14:15", cfgtype.MustNewTimezone("America/Chicago").Location()), }, "rfc-5424": { - Cfg: conf.MustNewConfigFrom(mapstr.M{}), - In: mapstr.M{ + cfg: conf.MustNewConfigFrom(mapstr.M{}), + in: mapstr.M{ "message": `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog 1024 ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"] this is the message`, }, - Want: mapstr.M{ + want: mapstr.M{ "log": mapstr.M{ "syslog": mapstr.M{ "priority": 165, @@ -127,7 +127,7 @@ var syslogCases = map[string]struct { }, "message": "this is the message", }, - WantTime: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + wantTime: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), }, } @@ -137,22 +137,22 @@ func TestSyslog(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - p, err := New(tc.Cfg) + p, err := New(tc.cfg) if err != nil { panic(err) } event := &beat.Event{ - Fields: tc.In, + Fields: tc.in, } got, gotErr := p.Run(event) - if tc.WantErr { + if tc.wantErr { assert.Error(t, gotErr) } else { assert.NoError(t, gotErr) } - assert.Equal(t, tc.Want, got.Fields) + assert.Equal(t, tc.want, got.Fields) }) } } @@ -164,9 +164,9 @@ func BenchmarkSyslog(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - p, _ := New(bc.Cfg) + p, _ := New(bc.cfg) event := &beat.Event{ - Fields: bc.In, + Fields: bc.in, } _, _ = p.Run(event) @@ -177,46 +177,46 @@ func BenchmarkSyslog(b *testing.B) { func TestAppendStringField(t *testing.T) { tests := map[string]struct { - InMap mapstr.M - InField string - InValue string - Want mapstr.M + inMap mapstr.M + inField string + inValue string + want mapstr.M }{ "nil": { - InMap: mapstr.M{}, - InField: "error", - InValue: "foo", - Want: mapstr.M{ + inMap: mapstr.M{}, + inField: "error", + inValue: "foo", + want: mapstr.M{ "error": "foo", }, }, "string": { - InMap: mapstr.M{ + inMap: mapstr.M{ "error": "foo", }, - InField: "error", - InValue: "bar", - Want: mapstr.M{ + inField: "error", + inValue: "bar", + want: mapstr.M{ "error": []string{"foo", "bar"}, }, }, "string-slice": { - InMap: mapstr.M{ + inMap: mapstr.M{ "error": []string{"foo", "bar"}, }, - InField: "error", - InValue: "some value", - Want: mapstr.M{ + inField: "error", + inValue: "some value", + want: mapstr.M{ "error": []string{"foo", "bar", "some value"}, }, }, "interface-slice": { - InMap: mapstr.M{ + inMap: mapstr.M{ "error": []interface{}{"foo", "bar"}, }, - InField: "error", - InValue: "some value", - Want: mapstr.M{ + inField: "error", + inValue: "some value", + want: mapstr.M{ "error": []interface{}{"foo", "bar", "some value"}, }, }, @@ -226,9 +226,9 @@ func TestAppendStringField(t *testing.T) { tc := tc t.Run(name, func(t *testing.T) { t.Parallel() - appendStringField(tc.InMap, tc.InField, tc.InValue) + appendStringField(tc.inMap, tc.inField, tc.inValue) - assert.Equal(t, tc.Want, tc.InMap) + assert.Equal(t, tc.want, tc.inMap) }) } } diff --git a/libbeat/reader/syslog/message_test.go b/libbeat/reader/syslog/message_test.go index c8514a960d75..29fe756c784c 100644 --- a/libbeat/reader/syslog/message_test.go +++ b/libbeat/reader/syslog/message_test.go @@ -55,31 +55,34 @@ func mustParseTime(layout, value string, loc *time.Location) time.Time { func TestMessage_SetTimestampBSD(t *testing.T) { cases := map[string]struct { - In string - InLoc *time.Location - Want time.Time - WantErr string + in string + inLoc *time.Location + want time.Time + wantErr string }{ "bsd-timestamp": { - In: "Oct 1 22:04:15", - InLoc: time.Local, - Want: mustParseTime(time.Stamp, "Oct 1 22:04:15", time.Local), + in: "Oct 1 22:04:15", + inLoc: time.Local, + want: mustParseTime(time.Stamp, "Oct 1 22:04:15", time.Local), }, "loc-nil": { - In: "Oct 1 22:04:15", - InLoc: nil, - Want: mustParseTime(time.Stamp, "Oct 1 22:04:15", time.Local), + in: "Oct 1 22:04:15", + inLoc: nil, + want: mustParseTime(time.Stamp, "Oct 1 22:04:15", time.Local), }, "invalid-timestamp-1": { - In: "1985-04-12T23:20:50.52Z", - InLoc: time.Local, + in: "1985-04-12T23:20:50.52Z", + inLoc: time.Local, + wantErr: `parsing time "1985-04-12T23:20:50.52Z" as "Jan _2 15:04:05": cannot parse "1985-04-12T23:20:50.52Z" as "Jan"`, }, "invalid-timestamp-2": { - In: "test-value", - InLoc: time.Local, + in: "test-value", + inLoc: time.Local, + wantErr: `parsing time "test-value" as "Jan _2 15:04:05": cannot parse "test-value" as "Jan"`, }, "empty": { - In: "", + in: "", + wantErr: `parsing time "" as "Jan _2 15:04:05": cannot parse "" as "Jan"`, }, } @@ -89,13 +92,14 @@ func TestMessage_SetTimestampBSD(t *testing.T) { t.Parallel() var m message - gotErr := m.setTimestampBSD(tc.In, tc.InLoc) + gotErr := m.setTimestampBSD(tc.in, tc.inLoc) - if tc.WantErr != "" { - assert.ErrorContains(t, gotErr, tc.WantErr) + if tc.wantErr != "" { + assert.ErrorContains(t, gotErr, tc.wantErr) assert.True(t, m.timestamp.IsZero()) } else { - assert.Equal(t, tc.Want, m.timestamp) + assert.Equal(t, tc.want, m.timestamp) + assert.NoError(t, gotErr) } }) } @@ -103,38 +107,41 @@ func TestMessage_SetTimestampBSD(t *testing.T) { func TestMessage_SetTimestampRFC3339(t *testing.T) { cases := map[string]struct { - In string - Want time.Time - WantErr string + in string + want time.Time + wantErr string }{ "rfc3339-timestamp": { - In: "1985-04-12T23:20:50.52Z", - Want: mustParseTime(time.RFC3339Nano, "1985-04-12T23:20:50.52Z", nil), + in: "1985-04-12T23:20:50.52Z", + want: mustParseTime(time.RFC3339Nano, "1985-04-12T23:20:50.52Z", nil), }, "rfc3339-timestamp-with-tz": { - In: "1985-04-12T19:20:50.52-04:00", - Want: mustParseTime(time.RFC3339Nano, "1985-04-12T19:20:50.52-04:00", nil), + in: "1985-04-12T19:20:50.52-04:00", + want: mustParseTime(time.RFC3339Nano, "1985-04-12T19:20:50.52-04:00", nil), }, "rfc3339-timestamp-with-milliseconds": { - In: "2003-10-11T22:14:15.123Z", - Want: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123Z", nil), + in: "2003-10-11T22:14:15.123Z", + want: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123Z", nil), }, "rfc3339-timestamp-with-microseconds": { - In: "2003-10-11T22:14:15.123456Z", - Want: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456Z", nil), + in: "2003-10-11T22:14:15.123456Z", + want: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456Z", nil), }, "rfc3339-timestamp-with-microseconds-with-tz": { - In: "2003-10-11T22:14:15.123456-06:00", - Want: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456-06:00", nil), + in: "2003-10-11T22:14:15.123456-06:00", + want: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456-06:00", nil), }, "invalid-timestamp-1": { - In: "Oct 1 22:04:15", + in: "Oct 1 22:04:15", + wantErr: `parsing time "Oct 1 22:04:15" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "Oct 1 22:04:15" as "2006"`, }, "invalid-timestamp-2": { - In: "test-value", + in: "test-value", + wantErr: `parsing time "test-value" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "test-value" as "2006"`, }, "empty": { - In: "", + in: "", + wantErr: `parsing time "" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "" as "2006"`, }, } @@ -144,13 +151,14 @@ func TestMessage_SetTimestampRFC3339(t *testing.T) { t.Parallel() var m message - gotErr := m.setTimestampRFC3339(tc.In) + gotErr := m.setTimestampRFC3339(tc.in) - if tc.WantErr != "" { - assert.ErrorContains(t, gotErr, tc.WantErr) + if tc.wantErr != "" { + assert.ErrorContains(t, gotErr, tc.wantErr) assert.True(t, m.timestamp.IsZero()) } else { - assert.Equal(t, tc.Want, m.timestamp) + assert.Equal(t, tc.want, m.timestamp) + assert.NoError(t, gotErr) } }) } @@ -158,29 +166,29 @@ func TestMessage_SetTimestampRFC3339(t *testing.T) { func TestMessage_SetPriority(t *testing.T) { cases := map[string]struct { - In string - WantPriority int - WantFacility int - WantSeverity int - WantErr string + in string + wantPriority int + wantFacility int + wantSeverity int + wantErr string }{ "13": { - In: "13", - WantPriority: 13, - WantFacility: 1, - WantSeverity: 5, + in: "13", + wantPriority: 13, + wantFacility: 1, + wantSeverity: 5, }, "192": { - In: "192", - WantErr: ErrPriority.Error(), + in: "192", + wantErr: ErrPriority.Error(), }, "-1": { - In: "-1", - WantErr: ErrPriority.Error(), + in: "-1", + wantErr: ErrPriority.Error(), }, "empty": { - In: "", - WantErr: `invalid priority: strconv.Atoi: parsing "": invalid syntax`, + in: "", + wantErr: `invalid priority: strconv.Atoi: parsing "": invalid syntax`, }, } @@ -190,18 +198,18 @@ func TestMessage_SetPriority(t *testing.T) { t.Parallel() m := message{priority: -1} - gotErr := m.setPriority(tc.In) + gotErr := m.setPriority(tc.in) - if tc.WantErr != "" { - assert.ErrorContains(t, gotErr, tc.WantErr) + if tc.wantErr != "" { + assert.ErrorContains(t, gotErr, tc.wantErr) assert.Equal(t, m.priority, -1) assert.Zero(t, m.facility) assert.Zero(t, m.severity) } else { assert.NoError(t, gotErr) - assert.Equal(t, tc.WantPriority, m.priority) - assert.Equal(t, tc.WantFacility, m.facility) - assert.Equal(t, tc.WantSeverity, m.severity) + assert.Equal(t, tc.wantPriority, m.priority) + assert.Equal(t, tc.wantFacility, m.facility) + assert.Equal(t, tc.wantSeverity, m.severity) } }) } @@ -209,18 +217,20 @@ func TestMessage_SetPriority(t *testing.T) { func TestMessage_SetHostname(t *testing.T) { cases := map[string]struct { - In string - Want string + in string + want string }{ "valid": { - In: "test-value", - Want: "test-value", + in: "test-value", + want: "test-value", }, "dash-ignored": { - In: "-", + in: "-", + want: "", }, "empty": { - In: "", + in: "", + want: "", }, } @@ -229,24 +239,25 @@ func TestMessage_SetHostname(t *testing.T) { t.Run(name, func(t *testing.T) { var m message - m.setHostname(tc.In) + m.setHostname(tc.in) - assert.Equal(t, tc.Want, m.hostname) + assert.Equal(t, tc.want, m.hostname) }) } } func TestMessage_SetMsg(t *testing.T) { cases := map[string]struct { - In string - Want string + in string + want string }{ "valid": { - In: "test-value", - Want: "test-value", + in: "test-value", + want: "test-value", }, "empty": { - In: "", + in: "", + want: "", }, } @@ -256,25 +267,25 @@ func TestMessage_SetMsg(t *testing.T) { t.Parallel() var m message - m.setMsg(tc.In) + m.setMsg(tc.in) - assert.Equal(t, tc.Want, m.msg) + assert.Equal(t, tc.want, m.msg) }) } } func TestMessage_SetTag(t *testing.T) { cases := map[string]struct { - In string - Want string - Name string + in string + want string }{ "valid": { - In: "test-value", - Want: "test-value", + in: "test-value", + want: "test-value", }, "empty": { - In: "", + in: "", + want: "", }, } @@ -283,27 +294,29 @@ func TestMessage_SetTag(t *testing.T) { t.Run(name, func(t *testing.T) { var m message - m.setTag(tc.In) + m.setTag(tc.in) - assert.Equal(t, tc.Want, m.process) + assert.Equal(t, tc.want, m.process) }) } } func TestMessage_SetAppName(t *testing.T) { cases := map[string]struct { - In string - Want string + in string + want string }{ "valid": { - In: "test-value", - Want: "test-value", + in: "test-value", + want: "test-value", }, "dash-ignored": { - In: "-", + in: "-", + want: "", }, "empty": { - In: "", + in: "", + want: "", }, } @@ -313,9 +326,9 @@ func TestMessage_SetAppName(t *testing.T) { t.Parallel() var m message - m.setAppName(tc.In) + m.setAppName(tc.in) - assert.Equal(t, tc.Want, m.process) + assert.Equal(t, tc.want, m.process) }) } @@ -323,46 +336,48 @@ func TestMessage_SetAppName(t *testing.T) { func TestMessage_SetContent(t *testing.T) { cases := map[string]struct { - In string - Want string - Name string + in string + want string }{ "valid": { - In: "test-value", - Want: "test-value", + in: "test-value", + want: "test-value", }, "empty": { - In: "", + in: "", + want: "", }, } - for _, tc := range cases { + for name, tc := range cases { tc := tc - t.Run(tc.Name, func(t *testing.T) { + t.Run(name, func(t *testing.T) { t.Parallel() var m message - m.setContent(tc.In) + m.setContent(tc.in) - assert.Equal(t, tc.Want, m.pid) + assert.Equal(t, tc.want, m.pid) }) } } func TestMessage_SetProcID(t *testing.T) { cases := map[string]struct { - In string - Want string + in string + want string }{ "valid": { - In: "test-value", - Want: "test-value", + in: "test-value", + want: "test-value", }, "dash-ignored": { - In: "-", + in: "-", + want: "", }, "empty": { - In: "", + in: "", + want: "", }, } @@ -372,24 +387,25 @@ func TestMessage_SetProcID(t *testing.T) { t.Parallel() var m message - m.setProcID(tc.In) + m.setProcID(tc.in) - assert.Equal(t, tc.Want, m.pid) + assert.Equal(t, tc.want, m.pid) }) } } func TestMessage_SetMsgID(t *testing.T) { cases := map[string]struct { - In string - Want string + in string + want string }{ "valid": { - In: "test-value", - Want: "test-value", + in: "test-value", + want: "test-value", }, "empty": { - In: "", + in: "", + want: "", }, } @@ -400,9 +416,9 @@ func TestMessage_SetMsgID(t *testing.T) { var m message - m.setMsgID(tc.In) + m.setMsgID(tc.in) - assert.Equal(t, tc.Want, m.msgID) + assert.Equal(t, tc.want, m.msgID) }) } @@ -410,17 +426,17 @@ func TestMessage_SetMsgID(t *testing.T) { func TestMessage_SetVersion(t *testing.T) { cases := map[string]struct { - In string - Want int - WantErr string + in string + want int + wantErr string }{ "valid": { - In: "100", - Want: 100, + in: "100", + want: 100, }, "empty": { - In: "", - WantErr: "invalid version, expected an integer: strconv.Atoi: parsing \"\"", + in: "", + wantErr: "invalid version, expected an integer: strconv.Atoi: parsing \"\"", }, } @@ -431,35 +447,37 @@ func TestMessage_SetVersion(t *testing.T) { var m message - gotErr := m.setVersion(tc.In) + gotErr := m.setVersion(tc.in) - if tc.WantErr != "" { - assert.ErrorContains(t, gotErr, tc.WantErr) + if tc.wantErr != "" { + assert.ErrorContains(t, gotErr, tc.wantErr) assert.Zero(t, m.version) } else { assert.NoError(t, gotErr) - assert.Equal(t, tc.Want, m.version) + assert.Equal(t, tc.want, m.version) } - assert.Equal(t, tc.Want, m.version) + assert.Equal(t, tc.want, m.version) }) } } func TestMessage_SetRawSDValue(t *testing.T) { cases := map[string]struct { - In string - Want string + in string + want string }{ "valid": { - In: `[value@1 foo="bar"]`, - Want: `[value@1 foo="bar"]`, + in: `[value@1 foo="bar"]`, + want: `[value@1 foo="bar"]`, }, "nil-value": { - In: "-", + in: "-", + want: "", }, "empty": { - In: "", + in: "", + want: "", }, } @@ -470,9 +488,9 @@ func TestMessage_SetRawSDValue(t *testing.T) { var m message - m.setRawSDValue(tc.In) + m.setRawSDValue(tc.in) - assert.Equal(t, tc.Want, m.rawSDValue) + assert.Equal(t, tc.want, m.rawSDValue) }) } @@ -480,20 +498,20 @@ func TestMessage_SetRawSDValue(t *testing.T) { func TestParseStructuredData(t *testing.T) { tests := map[string]struct { - In string - Want map[string]interface{} + in string + want map[string]interface{} }{ "basic": { - In: `[value@1 foo="bar"]`, - Want: map[string]interface{}{ + in: `[value@1 foo="bar"]`, + want: map[string]interface{}{ "value@1": map[string]interface{}{ "foo": "bar", }, }, }, "multi-key": { - In: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, - Want: map[string]interface{}{ + in: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + want: map[string]interface{}{ "exampleSDID@32473": map[string]interface{}{ "iut": "3", "eventSource": "Application", @@ -505,8 +523,8 @@ func TestParseStructuredData(t *testing.T) { }, }, "repeated-id": { - In: `[exampleSDID@32473 iut="3"][exampleSDID@32473 class="high"]`, - Want: map[string]interface{}{ + in: `[exampleSDID@32473 iut="3"][exampleSDID@32473 class="high"]`, + want: map[string]interface{}{ "exampleSDID@32473": map[string]interface{}{ "iut": "3", "class": "high", @@ -514,24 +532,24 @@ func TestParseStructuredData(t *testing.T) { }, }, "repeated-id-value": { - In: `[exampleSDID@32473 class="low"][exampleSDID@32473 class="high"]`, - Want: map[string]interface{}{ + in: `[exampleSDID@32473 class="low"][exampleSDID@32473 class="high"]`, + want: map[string]interface{}{ "exampleSDID@32473": map[string]interface{}{ "class": "high", }, }, }, "non-compliant": { - In: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, - Want: nil, + in: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + want: nil, }, "empty-string": { - In: ``, - Want: nil, + in: ``, + want: nil, }, "nil-value": { - In: `-`, - Want: nil, + in: `-`, + want: nil, }, } @@ -540,20 +558,20 @@ func TestParseStructuredData(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - got := parseStructuredData(tc.In) + got := parseStructuredData(tc.in) - assert.Equal(t, tc.Want, got) + assert.Equal(t, tc.want, got) }) } } func TestMessage_Fields(t *testing.T) { cases := map[string]struct { - In *message - Want mapstr.M + in *message + want mapstr.M }{ "valid": { - In: &message{ + in: &message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456-06:00", nil), facility: 1, severity: 5, @@ -566,7 +584,7 @@ func TestMessage_Fields(t *testing.T) { version: 1, rawSDValue: `[a b="c"]`, }, - Want: mapstr.M{ + want: mapstr.M{ "log": mapstr.M{ "syslog": mapstr.M{ "priority": 13, @@ -594,7 +612,7 @@ func TestMessage_Fields(t *testing.T) { }, }, "non-compliant-sd": { - In: &message{ + in: &message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456-06:00", nil), facility: 1, severity: 5, @@ -606,7 +624,7 @@ func TestMessage_Fields(t *testing.T) { version: 1, rawSDValue: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, }, - Want: mapstr.M{ + want: mapstr.M{ "log": mapstr.M{ "syslog": mapstr.M{ "priority": 13, @@ -629,7 +647,7 @@ func TestMessage_Fields(t *testing.T) { }, }, "non-compliant-sd-with-msg": { - In: &message{ + in: &message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.123456-06:00", nil), facility: 1, severity: 5, @@ -642,7 +660,7 @@ func TestMessage_Fields(t *testing.T) { msg: "This is a test message", rawSDValue: `[action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, }, - Want: mapstr.M{ + want: mapstr.M{ "log": mapstr.M{ "syslog": mapstr.M{ "priority": 13, @@ -671,9 +689,9 @@ func TestMessage_Fields(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - got := tc.In.fields() + got := tc.in.fields() - assert.Equal(t, tc.Want, got) + assert.Equal(t, tc.want, got) }) } } diff --git a/libbeat/reader/syslog/rfc3164_test.go b/libbeat/reader/syslog/rfc3164_test.go index 8b938d596ecf..562c7bcc2c86 100644 --- a/libbeat/reader/syslog/rfc3164_test.go +++ b/libbeat/reader/syslog/rfc3164_test.go @@ -26,13 +26,13 @@ import ( func TestParseRFC3164(t *testing.T) { tests := map[string]struct { - In string - Want message - WantErr string + in string + want message + wantErr string }{ "ok": { - In: "<13>Oct 11 22:14:15 test-host this is the message", - Want: message{ + in: "<13>Oct 11 22:14:15 test-host this is the message", + want: message{ timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), priority: 13, facility: 1, @@ -42,8 +42,8 @@ func TestParseRFC3164(t *testing.T) { }, }, "ok-rfc3339": { - In: "<13>2003-08-24T05:14:15.000003-07:00 test-host this is the message", - Want: message{ + in: "<13>2003-08-24T05:14:15.000003-07:00 test-host this is the message", + want: message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), priority: 13, facility: 1, @@ -53,8 +53,8 @@ func TestParseRFC3164(t *testing.T) { }, }, "ok-process": { - In: "<13>Oct 11 22:14:15 test-host su: this is the message", - Want: message{ + in: "<13>Oct 11 22:14:15 test-host su: this is the message", + want: message{ timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), priority: 13, facility: 1, @@ -65,8 +65,8 @@ func TestParseRFC3164(t *testing.T) { }, }, "ok-process-pid": { - In: "<13>Oct 11 22:14:15 test-host su[1024]: this is the message", - Want: message{ + in: "<13>Oct 11 22:14:15 test-host su[1024]: this is the message", + want: message{ timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), priority: 13, facility: 1, @@ -78,8 +78,8 @@ func TestParseRFC3164(t *testing.T) { }, }, "non-standard-date": { - In: "<123>Sep 01 02:03:04 hostname message", - Want: message{ + in: "<123>Sep 01 02:03:04 hostname message", + want: message{ timestamp: mustParseTime(time.Stamp, "Sep 1 02:03:04", time.Local), priority: 123, facility: 15, @@ -89,84 +89,84 @@ func TestParseRFC3164(t *testing.T) { }, }, "err-pri-not-a-number": { - In: "Oct 11 22:14:15 test-host this is the message", - Want: message{ + in: "Oct 11 22:14:15 test-host this is the message", + want: message{ timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), priority: -1, hostname: "test-host", msg: "this is the message", }, - WantErr: `validation error at position 2: invalid priority: strconv.Atoi: parsing "abc": invalid syntax`, + wantErr: `validation error at position 2: invalid priority: strconv.Atoi: parsing "abc": invalid syntax`, }, "err-pri-out-of-range": { - In: "<192>Oct 11 22:14:15 test-host this is the message", - Want: message{ + in: "<192>Oct 11 22:14:15 test-host this is the message", + want: message{ timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), priority: -1, hostname: "test-host", msg: "this is the message", }, - WantErr: ErrPriority.Error(), + wantErr: ErrPriority.Error(), }, "err-pri-negative": { - In: "<-1>Oct 11 22:14:15 test-host this is the message", - Want: message{ + in: "<-1>Oct 11 22:14:15 test-host this is the message", + want: message{ timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), priority: -1, hostname: "test-host", msg: "this is the message", }, - WantErr: ErrPriority.Error(), + wantErr: ErrPriority.Error(), }, "err-pri-missing-brackets": { - In: "13 Oct 11 22:14:15 test-host this is the message", - Want: message{ + in: "13 Oct 11 22:14:15 test-host this is the message", + want: message{ priority: -1, hostname: "Oct", msg: "11 22:14:15 test-host this is the message", }, - WantErr: `validation error at position 1: parsing time "13" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "13" as "2006"`, + wantErr: `validation error at position 1: parsing time "13" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "13" as "2006"`, }, "err-ts-invalid-missing": { - In: "<13> test-host this is the message", - Want: message{ + in: "<13> test-host this is the message", + want: message{ priority: 13, facility: 1, severity: 5, }, - WantErr: ErrEOF.Error(), + wantErr: ErrEOF.Error(), }, "err-ts-invalid-bsd": { - In: "<13>Foo 11 22:14:15 test-host this is the message", - Want: message{ + in: "<13>Foo 11 22:14:15 test-host this is the message", + want: message{ priority: 13, facility: 1, severity: 5, hostname: "test-host", msg: "this is the message", }, - WantErr: `validation error at position 5: parsing time "Foo 11 22:14:15" as "Jan _2 15:04:05": cannot parse "Foo 11 22:14:15" as "Jan"`, + wantErr: `validation error at position 5: parsing time "Foo 11 22:14:15" as "Jan _2 15:04:05": cannot parse "Foo 11 22:14:15" as "Jan"`, }, "err-ts-invalid-rfc3339": { - In: "<13>24-08-2003T05:14:15-07:00 test-host this is the message", - Want: message{ + in: "<13>24-08-2003T05:14:15-07:00 test-host this is the message", + want: message{ priority: 13, facility: 1, severity: 5, hostname: "test-host", msg: "this is the message", }, - WantErr: `validation error at position 5: parsing time "24-08-2003T05:14:15-07:00" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "8-2003T05:14:15-07:00" as "2006"`, + wantErr: `validation error at position 5: parsing time "24-08-2003T05:14:15-07:00" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "8-2003T05:14:15-07:00" as "2006"`, }, "err-eof": { - In: "<13>Oct 11 22:14:15 test-", - Want: message{ + in: "<13>Oct 11 22:14:15 test-", + want: message{ timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), priority: 13, facility: 1, severity: 5, }, - WantErr: `parsing error at position 26: message is truncated (unexpected EOF)`, + wantErr: `parsing error at position 26: message is truncated (unexpected EOF)`, }, } @@ -175,57 +175,57 @@ func TestParseRFC3164(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - got, gotErr := parseRFC3164(tc.In, time.Local) + got, gotErr := parseRFC3164(tc.in, time.Local) - if tc.WantErr != "" { - assert.ErrorContains(t, gotErr, tc.WantErr) + if tc.wantErr != "" { + assert.ErrorContains(t, gotErr, tc.wantErr) } else { assert.NoError(t, gotErr) } - assert.Equal(t, tc.Want, got) + assert.Equal(t, tc.want, got) }) } } func BenchmarkParseRFC3164(b *testing.B) { tests := map[string]struct { - In string + in string }{ "ok": { - In: "<13>Oct 11 22:14:15 test-host this is the message", + in: "<13>Oct 11 22:14:15 test-host this is the message", }, "ok-rfc3339": { - In: "<13>2003-08-24T05:14:15.000003-07:00 test-host this is the message", + in: "<13>2003-08-24T05:14:15.000003-07:00 test-host this is the message", }, "ok-process": { - In: "<13>Oct 11 22:14:15 test-host su: this is the message", + in: "<13>Oct 11 22:14:15 test-host su: this is the message", }, "ok-process-pid": { - In: "<13>Oct 11 22:14:15 test-host su[1024]: this is the message", + in: "<13>Oct 11 22:14:15 test-host su[1024]: this is the message", }, "non-standard-date": { - In: "<123>Sep 01 02:03:04 hostname message", + in: "<123>Sep 01 02:03:04 hostname message", }, "err-pri-not-a-number": { - In: "Oct 11 22:14:15 test-host this is the message", + in: "Oct 11 22:14:15 test-host this is the message", }, "err-pri-out-of-range": { - In: "<192>Oct 11 22:14:15 test-host this is the message", + in: "<192>Oct 11 22:14:15 test-host this is the message", }, "err-pri-negative": { - In: "<-1>Oct 11 22:14:15 test-host this is the message", + in: "<-1>Oct 11 22:14:15 test-host this is the message", }, "err-pri-missing-brackets": { - In: "13 Oct 11 22:14:15 test-host this is the message", + in: "13 Oct 11 22:14:15 test-host this is the message", }, "err-ts-invalid-missing": { - In: "<13> test-host this is the message", + in: "<13> test-host this is the message", }, "err-ts-invalid-bsd": { - In: "<13>Foo 11 22:14:15 test-host this is the message", + in: "<13>Foo 11 22:14:15 test-host this is the message", }, "err-ts-invalid-rfc3339": { - In: "<13>2003-08-24 05:14:15-07:00 test-host this is the message", + in: "<13>2003-08-24 05:14:15-07:00 test-host this is the message", }, } @@ -234,7 +234,7 @@ func BenchmarkParseRFC3164(b *testing.B) { b.Run(name, func(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - _, _ = parseRFC3164(bc.In, time.Local) + _, _ = parseRFC3164(bc.in, time.Local) } }) } diff --git a/libbeat/reader/syslog/rfc5424_test.go b/libbeat/reader/syslog/rfc5424_test.go index 248151f163a7..befd0c1fd8ae 100644 --- a/libbeat/reader/syslog/rfc5424_test.go +++ b/libbeat/reader/syslog/rfc5424_test.go @@ -26,13 +26,13 @@ import ( func TestParseRFC5424(t *testing.T) { tests := map[string]struct { - In string - Want message - WantErr string + in string + want message + wantErr string }{ "example-1": { - In: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", - Want: message{ + in: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + want: message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), priority: 13, facility: 1, @@ -46,8 +46,8 @@ func TestParseRFC5424(t *testing.T) { }, }, "example-2": { - In: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 [sd-id-1 foo="bar"] This is a test message`, - Want: message{ + in: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 [sd-id-1 foo="bar"] This is a test message`, + want: message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), priority: 13, facility: 1, @@ -62,8 +62,8 @@ func TestParseRFC5424(t *testing.T) { }, }, "example-3": { - In: `<13>1 - - - - - -`, - Want: message{ + in: `<13>1 - - - - - -`, + want: message{ priority: 13, facility: 1, severity: 5, @@ -71,8 +71,8 @@ func TestParseRFC5424(t *testing.T) { }, }, "example-4": { - In: `<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - ` + utf8BOM + `'su root' failed for user1 on /dev/pts/8`, - Want: message{ + in: `<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - ` + utf8BOM + `'su root' failed for user1 on /dev/pts/8`, + want: message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), priority: 34, facility: 4, @@ -85,8 +85,8 @@ func TestParseRFC5424(t *testing.T) { }, }, "example-5": { - In: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, - Want: message{ + in: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + want: message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), priority: 165, facility: 20, @@ -99,8 +99,8 @@ func TestParseRFC5424(t *testing.T) { }, }, "non-compliant-sd": { - In: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, - Want: message{ + in: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"]`, + want: message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), priority: 165, facility: 20, @@ -113,8 +113,8 @@ func TestParseRFC5424(t *testing.T) { }, }, "non-compliant-sd-with-msg": { - In: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"] This is a test message`, - Want: message{ + in: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [action:"Drop"; flags:"278528"; ifdir:"inbound"; ifname:"bond1.3999"; loguid:"{0x60928f1d,0x8,0x40de101f,0xfcdbb197}"; origin:"127.0.0.1"; originsicname:"CN=CP,O=cp.com.9jjkfo"; sequencenum:"62"; time:"1620217629"; version:"5"; __policy_id_tag:"product=VPN-1 & FireWall-1[db_tag={F6212FB3-54CE-6344-9164-B224119E2B92};mgmt=cp-m;date=1620031791;policy_name=CP-Cluster]"; action_reason:"Dropped by multiportal infrastructure"; dst:"81.2.69.144"; product:"VPN & FireWall"; proto:"6"; s_port:"52780"; service:"80"; src:"81.2.69.144"] This is a test message`, + want: message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), priority: 165, facility: 20, @@ -128,8 +128,8 @@ func TestParseRFC5424(t *testing.T) { }, }, "err-invalid-version": { - In: `<165>A 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, - Want: message{ + in: `<165>A 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + want: message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), priority: 165, facility: 20, @@ -139,11 +139,11 @@ func TestParseRFC5424(t *testing.T) { msgID: "ID47", rawSDValue: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, }, - WantErr: `validation error at position 6: invalid version, expected an integer: strconv.Atoi: parsing "A": invalid syntax`, + wantErr: `validation error at position 6: invalid version, expected an integer: strconv.Atoi: parsing "A": invalid syntax`, }, "err-invalid-timestamp": { - In: `<165>1 10-11-2003T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, - Want: message{ + in: `<165>1 10-11-2003T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + want: message{ priority: 165, facility: 20, severity: 5, @@ -153,11 +153,11 @@ func TestParseRFC5424(t *testing.T) { msgID: "ID47", rawSDValue: `[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, }, - WantErr: `validation error at position 8: parsing time "10-11-2003T22:14:15.003Z" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "1-2003T22:14:15.003Z" as "2006"`, + wantErr: `validation error at position 8: parsing time "10-11-2003T22:14:15.003Z" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "1-2003T22:14:15.003Z" as "2006"`, }, "err-eof": { - In: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-`, - Want: message{ + in: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-`, + want: message{ timestamp: mustParseTime(time.RFC3339Nano, "2003-08-24T05:14:15.000003-07:00", nil), priority: 13, facility: 1, @@ -167,7 +167,7 @@ func TestParseRFC5424(t *testing.T) { pid: "1234", version: 1, }, - WantErr: `parsing error at position 62: message is truncated (unexpected EOF)`, + wantErr: `parsing error at position 62: message is truncated (unexpected EOF)`, }, } @@ -176,37 +176,37 @@ func TestParseRFC5424(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - got, gotErr := parseRFC5424(tc.In) + got, gotErr := parseRFC5424(tc.in) - if tc.WantErr != "" { - assert.ErrorContains(t, gotErr, tc.WantErr) + if tc.wantErr != "" { + assert.ErrorContains(t, gotErr, tc.wantErr) } else { assert.NoError(t, gotErr) } - assert.Equal(t, tc.Want, got) + assert.Equal(t, tc.want, got) }) } } func BenchmarkParseRFC5424(b *testing.B) { tests := map[string]struct { - In string + in string }{ "example-1": { - In: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + in: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", }, "example-2": { - In: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 [sd-id-1 foo="bar"] This is a test message`, + in: `<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 [sd-id-1 foo="bar"] This is a test message`, }, "example-3": { - In: `<13>1 - - - - - -`, + in: `<13>1 - - - - - -`, }, "example-4": { - In: `<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - ` + utf8BOM + `'su root' failed for user1 on /dev/pts/8`, + in: `<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - ` + utf8BOM + `'su root' failed for user1 on /dev/pts/8`, }, "example-5": { - In: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, + in: `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"]`, }, } @@ -215,7 +215,7 @@ func BenchmarkParseRFC5424(b *testing.B) { b.Run(name, func(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - _, _ = parseRFC5424(bc.In) + _, _ = parseRFC5424(bc.in) } }) } @@ -223,20 +223,20 @@ func BenchmarkParseRFC5424(b *testing.B) { func TestIsRFC5424(t *testing.T) { tests := map[string]struct { - In string - Want bool + in string + want bool }{ "rfc-5424": { - In: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", - Want: true, + in: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + want: true, }, "rfc-3164": { - In: "<13>Oct 11 22:14:15 test-host this is the message", - Want: false, + in: "<13>Oct 11 22:14:15 test-host this is the message", + want: false, }, "invalid-message": { - In: "not a valid message", - Want: false, + in: "not a valid message", + want: false, }, } @@ -245,25 +245,25 @@ func TestIsRFC5424(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - got := isRFC5424(tc.In) + got := isRFC5424(tc.in) - assert.Equal(t, tc.Want, got) + assert.Equal(t, tc.want, got) }) } } func BenchmarkIsRFC5424(b *testing.B) { tests := map[string]struct { - In string + in string }{ "rfc-5424": { - In: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", + in: "<13>1 2003-08-24T05:14:15.000003-07:00 test-host su 1234 msg-5678 - This is a test message", }, "rfc-3164": { - In: "<13>Oct 11 22:14:15 test-host this is the message", + in: "<13>Oct 11 22:14:15 test-host this is the message", }, "invalid-message": { - In: "not a valid message", + in: "not a valid message", }, } @@ -272,7 +272,7 @@ func BenchmarkIsRFC5424(b *testing.B) { b.Run(name, func(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - _ = isRFC5424(bc.In) + _ = isRFC5424(bc.in) } }) } diff --git a/libbeat/reader/syslog/syslog_test.go b/libbeat/reader/syslog/syslog_test.go index 039517611bdc..bc124c19d464 100644 --- a/libbeat/reader/syslog/syslog_test.go +++ b/libbeat/reader/syslog/syslog_test.go @@ -59,30 +59,30 @@ func (t *testReader) Next() (reader.Message, error) { func TestNewParser(t *testing.T) { type testResult struct { - Timestamp time.Time - Content []byte - Fields mapstr.M - WantErr bool + timestamp time.Time + content []byte + fields mapstr.M + wantErr bool } referenceTime := time.Now() tests := map[string]struct { - Config Config - In [][]byte - Want []testResult + config Config + in [][]byte + want []testResult }{ "format-auto": { - Config: DefaultConfig(), - In: [][]byte{ + config: DefaultConfig(), + in: [][]byte{ []byte(`<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog 1024 ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"][examplePriority@32473 class="high"] this is the message`), []byte(`<13>Oct 11 22:14:15 test-host su[1024]: this is the message`), []byte(`Not a valid message.`), }, - Want: []testResult{ + want: []testResult{ { - Timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), - Content: []byte("this is the message"), - Fields: mapstr.M{ + timestamp: mustParseTime(time.RFC3339Nano, "2003-10-11T22:14:15.003Z", nil), + content: []byte("this is the message"), + fields: mapstr.M{ "log": mapstr.M{ "syslog": mapstr.M{ "priority": 165, @@ -115,9 +115,9 @@ func TestNewParser(t *testing.T) { }, }, { - Timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), - Content: []byte("this is the message"), - Fields: mapstr.M{ + timestamp: mustParseTime(time.Stamp, "Oct 11 22:14:15", time.Local), + content: []byte("this is the message"), + fields: mapstr.M{ "log": mapstr.M{ "syslog": mapstr.M{ "priority": 13, @@ -138,8 +138,8 @@ func TestNewParser(t *testing.T) { }, }, { - Timestamp: referenceTime, - WantErr: true, + timestamp: referenceTime, + wantErr: true, }, }, }, @@ -153,10 +153,10 @@ func TestNewParser(t *testing.T) { var got []reader.Message r := &testReader{ - messages: tc.In, + messages: tc.in, referenceTime: referenceTime, } - parser := NewParser(r, &tc.Config) + parser := NewParser(r, &tc.config) var err error var msg reader.Message @@ -169,22 +169,22 @@ func TestNewParser(t *testing.T) { got = append(got, msg) } - assert.Len(t, got, len(tc.Want)) - for i, want := range tc.Want { - if want.WantErr { - assert.Equal(t, tc.In[i], got[i].Content) - assert.Equal(t, len(tc.In[i]), got[i].Bytes) + assert.Len(t, got, len(tc.want)) + for i, want := range tc.want { + if want.wantErr { + assert.Equal(t, tc.in[i], got[i].Content) + assert.Equal(t, len(tc.in[i]), got[i].Bytes) assert.Equal(t, referenceTime, got[i].Ts) - if tc.Config.AddErrorKey { + if tc.config.AddErrorKey { _, errMsgErr := got[i].Fields.GetValue("error.message") assert.NoError(t, errMsgErr, "Expected error.message when Config.AddErrorKey true") } } else { - assert.Equal(t, want.Timestamp, got[i].Ts) - assert.Equal(t, want.Content, got[i].Content) - assert.Equal(t, len(want.Content), got[i].Bytes) - assert.Equal(t, want.Fields, got[i].Fields) + assert.Equal(t, want.timestamp, got[i].Ts) + assert.Equal(t, want.content, got[i].Content) + assert.Equal(t, len(want.content), got[i].Bytes) + assert.Equal(t, want.fields, got[i].Fields) } } }) diff --git a/libbeat/reader/syslog/util_test.go b/libbeat/reader/syslog/util_test.go index 29849858e600..8e74c6462ed2 100644 --- a/libbeat/reader/syslog/util_test.go +++ b/libbeat/reader/syslog/util_test.go @@ -27,32 +27,32 @@ import ( func TestStringToInt(t *testing.T) { cases := map[string]struct { - In string - Want int + in string + want int }{ "valid_1024": { - In: "1024", - Want: 1024, + in: "1024", + want: 1024, }, "valid_-1024": { - In: "-1024", - Want: -1024, + in: "-1024", + want: -1024, }, "valid_0": { - In: "0", - Want: 0, + in: "0", + want: 0, }, "invalid_-": { - In: "-", - Want: 0, + in: "-", + want: 0, }, "invalid_+": { - In: "+", - Want: 0, + in: "+", + want: 0, }, "invalid_empty": { - In: "", - Want: 0, + in: "", + want: 0, }, } @@ -60,72 +60,72 @@ func TestStringToInt(t *testing.T) { tc := tc t.Run(name, func(t *testing.T) { t.Parallel() - got := stringToInt(tc.In) + got := stringToInt(tc.in) - assert.Equal(t, tc.Want, got) + assert.Equal(t, tc.want, got) }) } } var removeBytesCases = map[string]struct { - In string - Positions []int - Offset int - Want string + in string + positions []int + offset int + want string }{ "basic-1": { - In: "abcdefghijklmno", - Positions: []int{3, 5, 6, 10, 12}, - Want: "abcehijlno", + in: "abcdefghijklmno", + positions: []int{3, 5, 6, 10, 12}, + want: "abcehijlno", }, "basic-2": { - In: "abcdefghijklmno", - Positions: []int{0, 5, 6, 10, 12}, - Want: "bcdehijlno", + in: "abcdefghijklmno", + positions: []int{0, 5, 6, 10, 12}, + want: "bcdehijlno", }, "basic-3": { - In: "abcdefghijklmno", - Positions: []int{0, 1, 2, 3, 4}, - Want: "fghijklmno", + in: "abcdefghijklmno", + positions: []int{0, 1, 2, 3, 4}, + want: "fghijklmno", }, "basic-4": { - In: "\\ab\\cd\\ef\\ghijklmno", - Positions: []int{0, 1, 2, 9}, - Want: "\\cd\\efghijklmno", + in: "\\ab\\cd\\ef\\ghijklmno", + positions: []int{0, 1, 2, 9}, + want: "\\cd\\efghijklmno", }, "offset-1": { - In: "abcdefghijklmno", - Positions: []int{5, 8, 9, 12}, - Offset: 5, - Want: "bcfgijklmno", + in: "abcdefghijklmno", + positions: []int{5, 8, 9, 12}, + offset: 5, + want: "bcfgijklmno", }, "no-positions": { - In: "abcdefghijklmno", - Positions: nil, - Want: "abcdefghijklmno", + in: "abcdefghijklmno", + positions: nil, + want: "abcdefghijklmno", }, "negative-offset": { - In: "abcdefghijklmno", - Positions: []int{5, 8, 9, 12}, - Offset: -1, - Want: "abcdefghijklmno", + in: "abcdefghijklmno", + positions: []int{5, 8, 9, 12}, + offset: -1, + want: "abcdefghijklmno", }, "too-many-positions": { - In: "abc", - Positions: []int{5, 8, 9, 12}, - Want: "abc", + in: "abc", + positions: []int{5, 8, 9, 12}, + want: "abc", }, "offset-position-negative": { - In: "abc", - Positions: []int{3}, - Offset: 5, - Want: "abc", + in: "abc", + positions: []int{3}, + offset: 5, + want: "abc", }, "offset-position-out-of-bounds": { - In: "abc", - Positions: []int{8}, - Offset: 5, - Want: "abc", + in: "abc", + positions: []int{8}, + offset: 5, + want: "abc", }, } @@ -135,9 +135,9 @@ func TestRemoveBytes(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - got := removeBytes(tc.In, tc.Positions, tc.Offset) + got := removeBytes(tc.in, tc.positions, tc.offset) - assert.Equal(t, tc.Want, got) + assert.Equal(t, tc.want, got) }) } } @@ -148,7 +148,7 @@ func BenchmarkRemoveBytes(b *testing.B) { b.Run(name, func(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - _ = removeBytes(bc.In, bc.Positions, bc.Offset) + _ = removeBytes(bc.in, bc.positions, bc.offset) } }) } @@ -161,27 +161,27 @@ func TestMapIndexToString(t *testing.T) { "C", } tests := map[string]struct { - In int - Want string - WantOK bool + in int + want string + wantOK bool }{ "valid-index-bottom": { - In: 0, - Want: items[0], - WantOK: true, + in: 0, + want: items[0], + wantOK: true, }, "valid-index-top": { - In: len(items) - 1, - Want: items[len(items)-1], - WantOK: true, + in: len(items) - 1, + want: items[len(items)-1], + wantOK: true, }, "invalid-index-high": { - In: len(items), - WantOK: false, + in: len(items), + wantOK: false, }, "invalid-index-low": { - In: -1, - WantOK: false, + in: -1, + wantOK: false, }, } @@ -190,56 +190,56 @@ func TestMapIndexToString(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - got, ok := mapIndexToString(tc.In, items) + got, ok := mapIndexToString(tc.in, items) - assert.Equal(t, tc.Want, got) - assert.Equal(t, tc.WantOK, ok) + assert.Equal(t, tc.want, got) + assert.Equal(t, tc.wantOK, ok) }) } } func TestAppendStringField(t *testing.T) { tests := map[string]struct { - InMap mapstr.M - InField string - InValue string - Want mapstr.M + inMap mapstr.M + inField string + inValue string + want mapstr.M }{ "nil": { - InMap: mapstr.M{}, - InField: "error", - InValue: "foo", - Want: mapstr.M{ + inMap: mapstr.M{}, + inField: "error", + inValue: "foo", + want: mapstr.M{ "error": "foo", }, }, "string": { - InMap: mapstr.M{ + inMap: mapstr.M{ "error": "foo", }, - InField: "error", - InValue: "bar", - Want: mapstr.M{ + inField: "error", + inValue: "bar", + want: mapstr.M{ "error": []string{"foo", "bar"}, }, }, "string-slice": { - InMap: mapstr.M{ + inMap: mapstr.M{ "error": []string{"foo", "bar"}, }, - InField: "error", - InValue: "some value", - Want: mapstr.M{ + inField: "error", + inValue: "some value", + want: mapstr.M{ "error": []string{"foo", "bar", "some value"}, }, }, "interface-slice": { - InMap: mapstr.M{ + inMap: mapstr.M{ "error": []interface{}{"foo", "bar"}, }, - InField: "error", - InValue: "some value", - Want: mapstr.M{ + inField: "error", + inValue: "some value", + want: mapstr.M{ "error": []interface{}{"foo", "bar", "some value"}, }, }, @@ -249,43 +249,43 @@ func TestAppendStringField(t *testing.T) { tc := tc t.Run(name, func(t *testing.T) { t.Parallel() - appendStringField(tc.InMap, tc.InField, tc.InValue) + appendStringField(tc.inMap, tc.inField, tc.inValue) - assert.Equal(t, tc.Want, tc.InMap) + assert.Equal(t, tc.want, tc.inMap) }) } } func TestJoinStr(t *testing.T) { tests := map[string]struct { - InA string - InB string - InSep string - Want string + inA string + inB string + inSep string + want string }{ "both-empty": { - InA: "", - InB: "", - InSep: " ", - Want: "", + inA: "", + inB: "", + inSep: " ", + want: "", }, "only-a": { - InA: "alpha", - InB: "", - InSep: " ", - Want: "alpha", + inA: "alpha", + inB: "", + inSep: " ", + want: "alpha", }, "only-b": { - InA: "", - InB: "beta", - InSep: " ", - Want: "beta", + inA: "", + inB: "beta", + inSep: " ", + want: "beta", }, "both": { - InA: "alpha", - InB: "beta", - InSep: " ", - Want: "alpha beta", + inA: "alpha", + inB: "beta", + inSep: " ", + want: "alpha beta", }, } @@ -294,9 +294,9 @@ func TestJoinStr(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - got := joinStr(tc.InA, tc.InB, tc.InSep) + got := joinStr(tc.inA, tc.inB, tc.inSep) - assert.Equal(t, tc.Want, got) + assert.Equal(t, tc.want, got) }) } } From e63dfb88278fe42594f08e0d5caa37e089646fe7 Mon Sep 17 00:00:00 2001 From: Taylor Swanson Date: Wed, 15 Jun 2022 09:10:42 -0500 Subject: [PATCH 9/9] Rename errors, improve test checks, readability improvements --- libbeat/reader/syslog/message.go | 2 +- libbeat/reader/syslog/parser/common.rl | 8 ++++---- .../reader/syslog/parser/parser_rfc3164.rl | 1 + .../reader/syslog/parser/parser_rfc5424.rl | 5 ++++- libbeat/reader/syslog/parser/rfc5424.rl | 2 +- libbeat/reader/syslog/rfc3164_gen.go | 11 +++++----- libbeat/reader/syslog/rfc3164_test.go | 8 ++++---- libbeat/reader/syslog/rfc5424_gen.go | 20 +++++++++++-------- libbeat/reader/syslog/rfc5424_test.go | 2 +- libbeat/reader/syslog/syslog.go | 16 +++++++-------- 10 files changed, 42 insertions(+), 33 deletions(-) diff --git a/libbeat/reader/syslog/message.go b/libbeat/reader/syslog/message.go index 0ded09467f74..e0ead1dbec09 100644 --- a/libbeat/reader/syslog/message.go +++ b/libbeat/reader/syslog/message.go @@ -123,7 +123,7 @@ func (m *message) setPriority(v string) error { } // Range defined by RFC. - if priority < 0 || priority > 191 { + if priority < 0 || 191 < priority { return ErrPriority } diff --git a/libbeat/reader/syslog/parser/common.rl b/libbeat/reader/syslog/parser/common.rl index 5bfac6bd588c..3a4f9efc07f6 100644 --- a/libbeat/reader/syslog/parser/common.rl +++ b/libbeat/reader/syslog/parser/common.rl @@ -7,19 +7,19 @@ action set_priority { if err := m.setPriority(data[tok:p]); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok+1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok+1}) } } action set_timestamp_rfc3339 { if err := m.setTimestampRFC3339(data[tok:p]); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok+1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok+1}) } } action set_timestamp_bsd { if err := m.setTimestampBSD(data[tok:p], loc); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok+1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok+1}) } } @@ -40,7 +40,7 @@ } action err_eof { - errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p+1}) + errs = multierr.Append(errs, &ParseError{Err: io.ErrUnexpectedEOF, Pos: p+1}) fhold; } diff --git a/libbeat/reader/syslog/parser/parser_rfc3164.rl b/libbeat/reader/syslog/parser/parser_rfc3164.rl index 0f7fc7810ddc..75a12a2406be 100644 --- a/libbeat/reader/syslog/parser/parser_rfc3164.rl +++ b/libbeat/reader/syslog/parser/parser_rfc3164.rl @@ -2,6 +2,7 @@ package syslog import ( + "io" "time" "go.uber.org/multierr" diff --git a/libbeat/reader/syslog/parser/parser_rfc5424.rl b/libbeat/reader/syslog/parser/parser_rfc5424.rl index 36e494278dc3..23929620a4c8 100644 --- a/libbeat/reader/syslog/parser/parser_rfc5424.rl +++ b/libbeat/reader/syslog/parser/parser_rfc5424.rl @@ -1,8 +1,11 @@ // Code generated by ragel. DO NOT EDIT. package syslog -import "go.uber.org/multierr" +import ( + "io" + "go.uber.org/multierr" +) %%{ machine rfc5424; diff --git a/libbeat/reader/syslog/parser/rfc5424.rl b/libbeat/reader/syslog/parser/rfc5424.rl index e00d820d8108..f7c5d1fb9205 100644 --- a/libbeat/reader/syslog/parser/rfc5424.rl +++ b/libbeat/reader/syslog/parser/rfc5424.rl @@ -18,7 +18,7 @@ action set_version { if err := m.setVersion(data[tok:p]); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok+1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok+1}) } } diff --git a/libbeat/reader/syslog/rfc3164_gen.go b/libbeat/reader/syslog/rfc3164_gen.go index 544fb0c921bb..852ec066f597 100644 --- a/libbeat/reader/syslog/rfc3164_gen.go +++ b/libbeat/reader/syslog/rfc3164_gen.go @@ -19,6 +19,7 @@ package syslog import ( + "io" "time" "go.uber.org/multierr" @@ -138,7 +139,7 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { goto tr0 tr0: - errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) + errs = multierr.Append(errs, &ParseError{Err: io.ErrUnexpectedEOF, Pos: p + 1}) p-- goto st0 @@ -195,14 +196,14 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { tr6: if err := m.setTimestampRFC3339(data[tok:p]); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok + 1}) } goto st4 tr30: if err := m.setTimestampBSD(data[tok:p], loc); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok + 1}) } goto st4 @@ -451,7 +452,7 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { tr15: if err := m.setPriority(data[tok:p]); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok + 1}) } goto st10 @@ -884,7 +885,7 @@ func parseRFC3164(data string, loc *time.Location) (message, error) { case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23: - errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) + errs = multierr.Append(errs, &ParseError{Err: io.ErrUnexpectedEOF, Pos: p + 1}) p-- } diff --git a/libbeat/reader/syslog/rfc3164_test.go b/libbeat/reader/syslog/rfc3164_test.go index 562c7bcc2c86..2f14fd9e22b1 100644 --- a/libbeat/reader/syslog/rfc3164_test.go +++ b/libbeat/reader/syslog/rfc3164_test.go @@ -106,7 +106,7 @@ func TestParseRFC3164(t *testing.T) { hostname: "test-host", msg: "this is the message", }, - wantErr: ErrPriority.Error(), + wantErr: `validation error at position 2: priority value out of range (expected 0..191)`, }, "err-pri-negative": { in: "<-1>Oct 11 22:14:15 test-host this is the message", @@ -116,7 +116,7 @@ func TestParseRFC3164(t *testing.T) { hostname: "test-host", msg: "this is the message", }, - wantErr: ErrPriority.Error(), + wantErr: `validation error at position 2: priority value out of range (expected 0..191)`, }, "err-pri-missing-brackets": { in: "13 Oct 11 22:14:15 test-host this is the message", @@ -134,7 +134,7 @@ func TestParseRFC3164(t *testing.T) { facility: 1, severity: 5, }, - wantErr: ErrEOF.Error(), + wantErr: `parsing error at position 5: unexpected EOF`, }, "err-ts-invalid-bsd": { in: "<13>Foo 11 22:14:15 test-host this is the message", @@ -166,7 +166,7 @@ func TestParseRFC3164(t *testing.T) { facility: 1, severity: 5, }, - wantErr: `parsing error at position 26: message is truncated (unexpected EOF)`, + wantErr: `parsing error at position 26: unexpected EOF`, }, } diff --git a/libbeat/reader/syslog/rfc5424_gen.go b/libbeat/reader/syslog/rfc5424_gen.go index 74c84192490f..fdfd46a2594e 100644 --- a/libbeat/reader/syslog/rfc5424_gen.go +++ b/libbeat/reader/syslog/rfc5424_gen.go @@ -18,7 +18,11 @@ // Code generated by ragel. DO NOT EDIT. package syslog -import "go.uber.org/multierr" +import ( + "io" + + "go.uber.org/multierr" +) const rfc5424_start int = 1 const rfc5424_first_final int = 23 @@ -121,7 +125,7 @@ func parseRFC5424(data string) (message, error) { goto tr0 tr0: - errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) + errs = multierr.Append(errs, &ParseError{Err: io.ErrUnexpectedEOF, Pos: p + 1}) p-- goto st0 @@ -158,7 +162,7 @@ func parseRFC5424(data string) (message, error) { tr4: if err := m.setPriority(data[tok:p]); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok + 1}) } goto st4 @@ -197,7 +201,7 @@ func parseRFC5424(data string) (message, error) { tr7: if err := m.setVersion(data[tok:p]); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok + 1}) } goto st6 @@ -225,7 +229,7 @@ func parseRFC5424(data string) (message, error) { tr31: if err := m.setTimestampRFC3339(data[tok:p]); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok + 1}) } goto st8 @@ -548,14 +552,14 @@ func parseRFC5424(data string) (message, error) { tr9: if err := m.setPriority(data[tok:p]); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok + 1}) } goto st22 tr6: if err := m.setPriority(data[tok:p]); err != nil { - errs = multierr.Append(errs, &ErrValidation{Err: err, Pos: tok + 1}) + errs = multierr.Append(errs, &ValidationError{Err: err, Pos: tok + 1}) } tok = p @@ -673,7 +677,7 @@ func parseRFC5424(data string) (message, error) { case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22: - errs = multierr.Append(errs, &ErrParsing{Err: ErrEOF, Pos: p + 1}) + errs = multierr.Append(errs, &ParseError{Err: io.ErrUnexpectedEOF, Pos: p + 1}) p-- case 26: diff --git a/libbeat/reader/syslog/rfc5424_test.go b/libbeat/reader/syslog/rfc5424_test.go index befd0c1fd8ae..539278a8c694 100644 --- a/libbeat/reader/syslog/rfc5424_test.go +++ b/libbeat/reader/syslog/rfc5424_test.go @@ -167,7 +167,7 @@ func TestParseRFC5424(t *testing.T) { pid: "1234", version: 1, }, - wantErr: `parsing error at position 62: message is truncated (unexpected EOF)`, + wantErr: `parsing error at position 62: unexpected EOF`, }, } diff --git a/libbeat/reader/syslog/syslog.go b/libbeat/reader/syslog/syslog.go index 5bbeaa8c13b7..4f4f5bc3dd08 100644 --- a/libbeat/reader/syslog/syslog.go +++ b/libbeat/reader/syslog/syslog.go @@ -44,8 +44,8 @@ var ( ErrEOF = errors.New("message is truncated (unexpected EOF)") ) -// ErrValidation represents data validation errors. -type ErrValidation struct { +// ValidationError represents data validation errors. +type ValidationError struct { // The underlying error. Err error // The position of the error. @@ -53,17 +53,17 @@ type ErrValidation struct { } // Error provides a descriptive error string. -func (e ErrValidation) Error() string { +func (e ValidationError) Error() string { return fmt.Sprintf("validation error at position %d: %v", e.Pos, e.Err) } // Unwrap provides the underlying error. -func (e ErrValidation) Unwrap() error { +func (e ValidationError) Unwrap() error { return e.Err } -// ErrParsing represents parsing errors. -type ErrParsing struct { +// ParseError represents parsing errors. +type ParseError struct { // The underlying error. Err error // The position of the error. @@ -71,12 +71,12 @@ type ErrParsing struct { } // Error provides a descriptive error string. -func (e ErrParsing) Error() string { +func (e ParseError) Error() string { return fmt.Sprintf("parsing error at position %d: %v", e.Pos, e.Err) } // Unwrap provides the underlying error. -func (e ErrParsing) Unwrap() error { +func (e ParseError) Unwrap() error { return e.Err }