Skip to content

Commit e1f9fd6

Browse files
committed
chore: fixup typos
Signed-off-by: Leonardo Di Donato <[email protected]>
1 parent 51a6175 commit e1f9fd6

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

rfc3164/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This package implements a parser for RFC3164 (BSD syslog) messages with extensio
44

55
## Overview
66

7-
RFC3164 is the original syslog protocol specification, commonly known as BSD syslog. Unlike [RFC5424](/rfc5424), RFC3164 has a loosely defined format, making it challenging to parse reliably. This parser handles the standard format plus common variations.
7+
RFC3164 is the original syslog protocol specification, commonly known as BSD syslog. Unlike [RFC5424](../rfc5424), RFC3164 has a loosely defined format, making it challenging to parse reliably. This parser handles the standard format plus common variations.
88

99
## Standard RFC3164 Format
1010

@@ -33,9 +33,10 @@ if err != nil {
3333
}
3434

3535
// Access parsed fields
36-
fmt.Printf("Priority: %d\n", *msg.(*SyslogMessage).Priority)
37-
fmt.Printf("Hostname: %s\n", *msg.(*SyslogMessage).Hostname)
38-
fmt.Printf("Message: %s\n", *msg.(*SyslogMessage).Message)
36+
m := msg.(*rfc3164.SyslogMessage)
37+
fmt.Printf("Priority: %d\n", *m.Priority)
38+
fmt.Printf("Hostname: %s\n", *m.Hostname)
39+
fmt.Printf("Message: %s\n", *m.Message)
3940
```
4041

4142
## Parser Options

rfc3164/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func ExampleParser_ciscoIOSLeadingColon() {
328328
// due to a mismatch between the device configuration and the parser configuration.
329329
//
330330
// The error message "expecting a sequence number" actually means:
331-
// "I see digits that look like a sequence number, but you haven't enabled sequence number parsin. You need to configure the parser to handle this".
331+
// "I see digits that look like a sequence number, but you haven't enabled sequence number parsing. You need to configure the parser to handle this".
332332
func ExampleParser_ciscoIOSConfigMismatch() {
333333
// Device configured with both message counter and sequence number
334334
i := []byte(`<189>237: 000485: *Jan 8 19:46:03.295: %SYS-5-CONFIG_I: Configured from console`)

rfc3164/machine_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,7 @@ var testCases = []testCase{
359359
// device sends msgcount+sequence, parser expects only msgcount.
360360
// Parser successfully parses msgcount (269614),
361361
// then fails at col 13 when it sees another number (000104) instead of timestamp.
362-
//
363-
// This demonstrates a known limitation: the parser cannot auto-detect which
364-
// Cisco components are present because they all follow the pattern "digits/alphanum:".
365-
// Users must configure the parser flags to match their Cisco device configuration.
366-
// Mismatched configuration will result in parsing errors or incorrect field values.
362+
// Demonstrates the known limitation that parser cannot auto-detect components.
367363
opts: []syslog.MachineOption{
368364
WithCiscoIOSComponents(ciscoios.DisableSequenceNumber | ciscoios.DisableHostname),
369365
},

0 commit comments

Comments
 (0)