Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timestamp parser error in cisco_catalyst plugin #375

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- `haproxy`: Fixed typo with field name `query_parameter` ([PR368](https://github.com/observIQ/stanza-plugins/pull/368))
- `cisco_catalyst`: Fix timestamp parse issue with `*` in front of timestamp. ([PR375](https://github.com/observIQ/stanza-plugins/pull/375))

## [0.0.87] 2021-10-11

Expand Down
7 changes: 4 additions & 3 deletions plugins/cisco_catalyst.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.0.2
version: 0.0.3
title: Cisco Catalyst
description: Log parser for Cisco Catalyst
supported_platforms:
Expand Down Expand Up @@ -44,7 +44,7 @@ pipeline:
routes:
- expr: '$record.message matches "^<[^>]+>"'
output: syslog_beginning_parser
- expr: '$record.message matches "^[\\d]+:\\s+\\w+\\s+\\d+\\s+\\d+:\\d+:\\d+\\s+\\w+:"'
- expr: '$record.message matches "^[\\d]+:\\s+(\\*)?\\w+\\s+\\d+\\s+\\d+:\\d+:\\d+\\s+\\w+:"'
output: catalyst_parser

- id: syslog_beginning_parser
Expand All @@ -55,8 +55,9 @@ pipeline:
output: catalyst_parser

- id: catalyst_parser
if: '$record.message matches "^[\\d]+:\\s+(\\*)?\\w+\\s+\\d+\\s+\\d+:\\d+:\\d+\\s+\\w+:"'
type: regex_parser
regex: '^(?P<sequence_number>\d+):\s+(?P<timestamp>\w{3}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+\w{3}):\s+%(?P<facility_text>[^-]+)-(?P<severity>\d+)-(?P<mnemonic>[^:]+):\s*(?P<message>.*)'
regex: '^(?P<sequence_number>\d+):\s+(\*)?(?P<timestamp>\w{3}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+\w{3}):\s+%(?P<facility_text>[^-]+)-(?P<severity>\d+)-(?P<mnemonic>[^:]+):\s*(?P<message>.*)'
parse_from: message
timestamp:
parse_from: $record.timestamp
Expand Down