Skip to content

Commit 51a6175

Browse files
committed
docs(rfc3164): add example for Cisco IOS config mismatch with actual input format in README
Signed-off-by: Leonardo Di Donato <[email protected]>
1 parent a359ffd commit 51a6175

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

rfc3164/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@ For Cisco IOS configuration details, see the `WithCiscoIOSComponents()` function
122122

123123
**Important**: Your parser configuration must match your Cisco device configuration. The parser cannot auto-detect which components are present because they share similar formats (mostly digits followed by colon).
124124

125+
What happens when there's a mismatch?
126+
127+
```go
128+
// Device sends both message counter and sequence number: <189>237: 000485: *Jan 8 19:46:03.295: ...
129+
// Parser configured for message counter only (mismatch):
130+
p := rfc3164.NewParser(
131+
rfc3164.WithCiscoIOSComponents(ciscoios.DisableSequenceNumber),
132+
)
133+
// Result: Parse error "expecting a sequence number (from 1 to max 255 digits) [col 10]"
134+
// Parser found digits where it expects timestamp, indicating sequence parsing should be enabled.
135+
```
136+
125137
##### Cisco Device Configuration
126138

127139
```cisco
@@ -157,4 +169,4 @@ RFC3164 has an underspecified format, leading to parsing challenges:
157169

158170
**Component Ordering**: When Cisco components are selectively disabled on the device but the parser expects them, parsing will fail or produce incorrect results. Always match your parser configuration to your device configuration.
159171

160-
**Structured Data**: Cisco IOS messages with RFC5424-style structured data blocks (from `logging host X session-id` or `sequence-num-session`) are not currently supported. See issue #[TBD] for details.
172+
**Structured Data**: Cisco IOS messages with RFC5424-style structured data blocks (from `logging host X session-id` or `sequence-num-session`) are not currently supported. See issue #35 for details.

0 commit comments

Comments
 (0)