Skip to content

Commit 900865f

Browse files
[cisco_nexus] Generate processor tags and normalize error handler
- Generate tags for processors missing tags - Normalize the pipeline error handler
1 parent 532c964 commit 900865f

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

packages/cisco_nexus/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.4.4"
3+
changes:
4+
- description: Generate processor tags and normalize error handler.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/15533
27
- version: "1.4.3"
38
changes:
49
- description: Fix whitespace issue with grok pattern.

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ processors:
5151
- "^%{NEXUS_TIMESTAMP:temp.timestamp}%{SPACE}(%{IP:cisco_nexus.log.ip_address}|%{NOTSPACE:cisco_nexus.log.switch_name})%{SPACE}%{NEXUS_BODY}$"
5252
on_failure:
5353
- append:
54+
tag: append_error_message_6a5a74a1
5455
field: error.message
5556
value: "Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}"
5657
# If a timezone is present from the vendor, we will check if it matches an entry in the tz_map to convert it.
@@ -119,6 +120,7 @@ processors:
119120
- MMM d HH:mm:ss.SSS
120121
on_failure:
121122
- append:
123+
tag: append_error_message_ebfd3d8f
122124
field: error.message
123125
value: "Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}"
124126
# Sets the @timestamp field when a timezone exists or has been set by tz_offset.
@@ -148,6 +150,7 @@ processors:
148150
- MMM d HH:mm:ss.SSS
149151
on_failure:
150152
- append:
153+
tag: append_error_message_39d81770
151154
field: error.message
152155
value: "Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}"
153156
# To parse the syslog timestamp into the correct format when event.timezone is set
@@ -166,6 +169,7 @@ processors:
166169
- MMM d HH:mm:ss.SSS
167170
on_failure:
168171
- append:
172+
tag: append_error_message_8eb784d7
169173
field: error.message
170174
value: "Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}"
171175
# To parse the syslog timestamp into the correct format when event.timezone is not set
@@ -183,6 +187,7 @@ processors:
183187
- MMM d HH:mm:ss.SSS
184188
on_failure:
185189
- append:
190+
tag: append_error_message_6e22be52
186191
field: error.message
187192
value: "Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}"
188193
@@ -269,6 +274,7 @@ processors:
269274
}
270275
on_failure:
271276
- append:
277+
tag: append_error_message_aae2588f
272278
field: error.message
273279
value: "Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}"
274280
- script:
@@ -281,6 +287,7 @@ processors:
281287
ctx.log.syslog.facility.code = (ctx.cisco_nexus.log.priority_number - ctx.event.severity)/8;
282288
on_failure:
283289
- append:
290+
tag: append_error_message_000f13b5
284291
field: error.message
285292
value: "Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}"
286293
- trim:
@@ -346,7 +353,11 @@ processors:
346353
on_failure:
347354
- append:
348355
field: error.message
349-
value: "Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}"
356+
value: >-
357+
Processor '{{{ _ingest.on_failure_processor_type }}}'
358+
{{#_ingest.on_failure_processor_tag}}with tag '{{{ _ingest.on_failure_processor_tag }}}'
359+
{{/_ingest.on_failure_processor_tag}}in pipeline '{{{ _ingest.pipeline }}}'
360+
failed with message '{{{ _ingest.on_failure_message }}}'
350361
- set:
351362
field: event.kind
352363
value: pipeline_error

packages/cisco_nexus/data_stream/log/elasticsearch/ingest_pipeline/pipeline_extract_message.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
processors:
33
- grok:
4+
tag: grok_message_229845cb
45
description: Extract IF_DOWN_ADMIN_DOWN, IF_ADMIN_UP, SPEED, IF_DUPLEX, IF_RX_FLOW_CONTROL, IF_TX_FLOW_CONTROL, IF_UP, IF_XCVR_WARNING MNEMONIC.
56
field: message
67
if: "['IF_DOWN_ADMIN_DOWN','IF_ADMIN_UP','SPEED','IF_DUPLEX','IF_RX_FLOW_CONTROL','IF_TX_FLOW_CONTROL','IF_UP','IF_XCVR_WARNING'].contains(ctx.event?.code.toUpperCase())"
@@ -14,6 +15,7 @@ processors:
1415
- '^(?:%{GREEDYDATA}%{SPACE}(?i)interface)%{SPACE}%{DATA:cisco_nexus.log.interface.name}, %{GREEDYDATA}$'
1516
ignore_failure: true
1617
- grok:
18+
tag: grok_message_2528203a
1719
description: Extract VSHD_SYSLOG_CONFIG_I, DETECT_MULTIPLE_PEERS, UPDOWN, CFGWRITE_STARTED, LINEPROTO MNEMONIC.
1820
field: message
1921
if: "['VSHD_SYSLOG_CONFIG_I','DETECT_MULTIPLE_PEERS','UPDOWN','CFGWRITE_STARTED','LINEPROTO'].contains(ctx.event?.code.toUpperCase())"
@@ -25,6 +27,7 @@ processors:
2527
- '^%{DATA}(PID %{NUMBER:process.pid:long})%{GREEDYDATA}$'
2628
ignore_failure: true
2729
- grok:
30+
tag: grok_message_3172da53
2831
description: Extract SYSTEM_MSG MNEMONIC.
2932
field: message
3033
if: "['SYSTEM_MSG'].contains(ctx.event?.code.toUpperCase())"
@@ -36,6 +39,7 @@ processors:
3639
- '^%{DATA} : %{GREEDYDATA:temp.message2}$'
3740
ignore_failure: true
3841
- grok:
42+
tag: grok_message_f92a0857
3943
description: Extract INVAL_IP, L2FM_MAC_MOVE2, DUPLEX_MISMATCH, NATIVE_VLAN_MISMATCH, THRESHOLD_VIOLATION MNEMONIC.
4044
field: message
4145
if: "['INVAL_IP','L2FM_MAC_MOVE2','DUPLEX_MISMATCH','NATIVE_VLAN_MISMATCH','THRESHOLD_VIOLATION'].contains(ctx.event?.code.toUpperCase())"
@@ -46,6 +50,7 @@ processors:
4650
- '^%{DATA:cisco_nexus.log.interface.name}: Rx power high warning; Operating value: %{DATA:cisco_nexus.log.operating_value}, Threshold value: %{DATA:cisco_nexus.log.threshold_value}.$'
4751
ignore_failure: true
4852
- grok:
53+
tag: grok_message_a1e9a4a1
4954
description: Extract LOGIN_SUCCESS, LOGOUT,LOGOUT_C6K MNEMONIC.
5055
field: message
5156
if: "['LOGIN_SUCCESS','LOGOUT','LOGOUT_C6K'].contains(ctx.event?.code.toUpperCase())"
@@ -61,6 +66,7 @@ processors:
6166
ignore_missing: true
6267
on_failure:
6368
- append:
69+
tag: append_error_message_8428fc3c
6470
field: error.message
6571
value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}'
6672
- gsub:
@@ -71,20 +77,23 @@ processors:
7177
ignore_missing: true
7278
on_failure:
7379
- append:
80+
tag: append_error_message_660fea7e
7481
field: error.message
7582
value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}'
7683
- uppercase:
7784
field: source.mac
7885
ignore_missing: true
7986
tag: 'uppercase_source_mac'
8087
- kv:
88+
tag: kv_temp_message_to_temp_af9c5b5f
8189
field: temp.message
8290
target_field: temp
8391
field_split: '\s+'
8492
value_split: '='
8593
ignore_missing: true
8694
ignore_failure: true
8795
- kv:
96+
tag: kv_temp_message2_to_temp_d53f7654
8897
field: temp.message2
8998
target_field: temp
9099
field_split: ' ; '
@@ -208,4 +217,8 @@ on_failure:
208217
value: pipeline_error
209218
- append:
210219
field: error.message
211-
value: '{{{ _ingest.on_failure_message }}}'
220+
value: >-
221+
Processor '{{{ _ingest.on_failure_processor_type }}}'
222+
{{#_ingest.on_failure_processor_tag}}with tag '{{{ _ingest.on_failure_processor_tag }}}'
223+
{{/_ingest.on_failure_processor_tag}}in pipeline '{{{ _ingest.pipeline }}}'
224+
failed with message '{{{ _ingest.on_failure_message }}}'

packages/cisco_nexus/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_nexus
33
title: Cisco Nexus
4-
version: "1.4.3"
4+
version: "1.4.4"
55
description: Collect logs from Cisco Nexus with Elastic Agent.
66
type: integration
77
categories:

0 commit comments

Comments
 (0)