Skip to content

Commit b698afe

Browse files
authored
[cisco_ios] Handle timestamp starting with the year such as 'yyyy MMM d HH:mm:ss.SSS z' (#10916)
* [cisco_ios] Handle timestamp starting with the year such as 'yyyy MMM d HH:mm:ss.SSS z' * Updated changelog PR number * Make linter happy
1 parent 64dd362 commit b698afe

File tree

5 files changed

+57
-2
lines changed

5 files changed

+57
-2
lines changed

packages/cisco_ios/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "1.27.1"
3+
changes:
4+
- description: Handle timestamp starting with the year such as 'yyyy MMM d HH:mm:ss.SSS z'
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/10916
27
- version: "1.27.0"
38
changes:
49
- description: "Allow @custom pipeline access to event.original without setting preserve_original_event."
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<46>: 2024 Aug 27 21:40:50 PDT: %SNMPD-6-INFO: SNMP log informational : Processing packet for non-MTS (sockets)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"expected": [
3+
{
4+
"@timestamp": "2024-08-27T21:40:50.000-07:00",
5+
"cisco": {
6+
"ios": {
7+
"facility": "SNMPD"
8+
}
9+
},
10+
"ecs": {
11+
"version": "8.11.0"
12+
},
13+
"event": {
14+
"category": [
15+
"network"
16+
],
17+
"code": "INFO",
18+
"original": "<46>: 2024 Aug 27 21:40:50 PDT: %SNMPD-6-INFO: SNMP log informational : Processing packet for non-MTS (sockets)",
19+
"provider": "firewall",
20+
"severity": 6,
21+
"type": [
22+
"info"
23+
]
24+
},
25+
"log": {
26+
"level": "informational",
27+
"syslog": {
28+
"priority": 46
29+
}
30+
},
31+
"message": "SNMP log informational : Processing packet for non-MTS (sockets)",
32+
"observer": {
33+
"product": "IOS",
34+
"type": "firewall",
35+
"vendor": "Cisco"
36+
},
37+
"tags": [
38+
"preserve_original_event"
39+
]
40+
}
41+
]
42+
}

packages/cisco_ios/data_stream/log/elasticsearch/ingest_pipeline/default.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ processors:
4343
- '^%{SYSLOGTIMESTAMP} (?:%{IP}|%{HOSTNAME:log.syslog.hostname}) %{CISCO_PRIORITY_MSGCOUNT}?(?:%{NUMBER:cisco.ios.sequence}: )%{GREEDYDATA:_temp_.message}$'
4444
pattern_definitions:
4545
CISCO_PRIORITY_MSGCOUNT: '<%{NONNEGINT:log.syslog.priority:long}>(?:%{NONNEGINT:cisco.ios.message_count})?(?:: )?'
46-
CISCO_TIMESTAMP: '[*]?%{CISCOTIMESTAMP:_temp_.cisco_timestamp}(?: %{CISCO_TZ:_temp_.tz})?'
46+
CISCO_TIMESTAMP: '[*]?%{CISCOTIMESTAMP_EX:_temp_.cisco_timestamp}(?: %{CISCO_TZ:_temp_.tz})?'
47+
CISCOTIMESTAMP_EX: '(%{CISCOTIMESTAMP})|(%{YEAR} %{MONTH} %{MONTHDAY} %{TIME})'
4748
CISCO_UPTIME: '[0-9a-zA-Z]+'
4849
CISCO_HOSTNAME: '[a-zA-Z][0-9a-zA-Z_-]{0,61}[0-9a-zA-Z]?'
4950
CISCO_TZ: '[a-zA-Z]{1,4}([+-]\d{1,2}|[+-]\d{2}:\d{2})?'
@@ -137,6 +138,12 @@ processors:
137138
- "MMM d HH:mm:ss.SSS"
138139
- "MMM d HH:mm:ss z"
139140
- "MMM d HH:mm:ss"
141+
142+
# Year first
143+
- "yyyy MMM d HH:mm:ss.SSS z"
144+
- "yyyy MMM d HH:mm:ss.SSS"
145+
- "yyyy MMM d HH:mm:ss z"
146+
- "yyyy MMM d HH:mm:ss"
140147
timezone: '{{{_temp_.date_timezone}}}'
141148
- grok:
142149
field: message

packages/cisco_ios/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: "3.0.3"
22
name: cisco_ios
33
title: Cisco IOS
4-
version: "1.27.0"
4+
version: "1.27.1"
55
description: Collect logs from Cisco IOS with Elastic Agent.
66
type: integration
77
categories:

0 commit comments

Comments
 (0)