Skip to content

Commit edb4ef1

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

File tree

3 files changed

+63
-5
lines changed

3 files changed

+63
-5
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.32.1"
3+
changes:
4+
- description: Generate processor tags and normalize error handler.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/15531
27
- version: "1.32.0"
38
changes:
49
- description: Add Grok and Dissect patterns to support multiple IPACCESSLOGP log formats with Event Code Trimming.

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

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,47 @@ description: Pipeline for Cisco IOS logs.
33

44
processors:
55
- set:
6+
tag: set_ecs_version_f5923549
67
field: ecs.version
78
value: '8.17.0'
89
- set:
10+
tag: set_event_category_dbab8a4e
911
field: event.category
1012
value: [network]
1113
- set:
14+
tag: set_event_provider_4a3b5b7b
1215
field: event.provider
1316
value: firewall
1417
- set:
18+
tag: set_observer_vendor_e0ee74d1
1519
field: observer.vendor
1620
value: Cisco
1721
- set:
22+
tag: set_observer_product_b4ddab2e
1823
field: observer.product
1924
value: IOS
2025
- set:
26+
tag: set_observer_type_5dddf3ba
2127
field: observer.type
2228
value: firewall
2329
- set:
30+
tag: set_event_type_ec95f7f2
2431
field: event.type
2532
value: [info]
2633

2734
- set:
35+
tag: set_event_original_49bb683a
2836
field: event.original
2937
copy_from: message
3038
override: false
3139
- remove:
40+
tag: remove_message_884e8cdd
3241
field: message
3342
ignore_missing: true
3443
- grok:
3544
field: event.original
3645
tag: grok_kiwi_header
37-
description: |-
46+
description: |-
3847
The Kiwi syslog header is expected to be in the following format:
3948
<PRI>Original Address=IP [RFC 5424 header] [Cisco IOS log]
4049
@@ -72,28 +81,34 @@ processors:
7281
- '^%{GREEDYDATA:_temp_.generic_message}$'
7382
# Handle all-digit hostnames as sequence numbers
7483
- grok:
84+
tag: grok_log_syslog_hostname_54433610
7585
field: log.syslog.hostname
7686
patterns:
7787
- '^%{NUMBER:_temp_.sequence}$'
7888
ignore_missing: true
79-
ignore_failure: true
89+
ignore_failure: true
8090
- set:
91+
tag: set_cisco_ios_sequence_c92644b4
8192
field: cisco.ios.sequence
8293
copy_from: _temp_.sequence
8394
if: ctx._temp_?.sequence != null
8495
- remove:
96+
tag: remove_log_syslog_hostname_c2980acf
8597
field: log.syslog.hostname
8698
if: ctx._temp_?.sequence != null
8799
ignore_missing: true
88100
- remove:
101+
tag: remove__temp__sequence_0d8feeaa
89102
field: _temp_.sequence
90103
if: ctx._temp_?.sequence != null
91104
ignore_missing: true
92105
- remove:
106+
tag: remove_log_syslog_e1fd9ebc
93107
field: log.syslog
94108
if: "ctx.log?.syslog != null && ctx.log.syslog.isEmpty()"
95109
ignore_missing: true
96110
- set:
111+
tag: set_event_sequence_87d344b3
97112
field: event.sequence
98113
copy_from: cisco.ios.sequence
99114
if: ctx.cisco?.ios?.sequence != null
@@ -103,6 +118,7 @@ processors:
103118
type: long
104119
if: ctx.cisco?.ios?.message_count != null
105120
- set:
121+
tag: set_event_sequence_f800e4a1
106122
field: event.sequence
107123
copy_from: cisco.ios.message_count
108124
if: ctx.cisco?.ios?.message_count != null && ctx.event?.sequence == null
@@ -299,14 +315,17 @@ processors:
299315
PIM_SOURCE: (%{IP:cisco.ios.pim.source.ip}|%{DATA})
300316
if: "ctx.event?.code == 'INVALID_RP_JOIN'"
301317
- set:
318+
tag: set_event_action_1270922c
302319
field: event.action
303320
value: "multicast-join"
304321
if: ctx.event?.code == "INVALID_RP_JOIN"
305322
- set:
323+
tag: set_event_outcome_030de70b
306324
field: event.outcome
307325
value: "failure"
308326
if: ctx.event?.code == "INVALID_RP_JOIN"
309327
- set:
328+
tag: set_event_reason_64638ad4
310329
field: event.reason
311330
value: "Invalid RP"
312331
if: ctx.event?.code == "INVALID_RP_JOIN"
@@ -318,6 +337,7 @@ processors:
318337
ignore_missing: true
319338
on_failure:
320339
- set:
340+
tag: set_destination_domain_1a39ddcb
321341
field: destination.domain
322342
copy_from: destination.address
323343
- convert:
@@ -328,6 +348,7 @@ processors:
328348
ignore_missing: true
329349
on_failure:
330350
- set:
351+
tag: set_source_domain_5044c678
331352
field: source.domain
332353
copy_from: source.address
333354
- convert:
@@ -351,6 +372,7 @@ processors:
351372
tag: convert_destination_port
352373
ignore_missing: true
353374
- script:
375+
tag: script_a90fa837
354376
lang: painless
355377
source: |
356378
long n = 0;
@@ -367,62 +389,77 @@ processors:
367389
if: ctx.source?.bytes != null || ctx.destination?.bytes != null
368390
ignore_failure: true
369391
- set:
392+
tag: set_network_packets_4ee14814
370393
field: network.packets
371394
copy_from: source.packets
372395
if: ctx.source?.packets != null
373396
- set:
397+
tag: set_network_type_d0af2f05
374398
field: network.type
375399
value: ipv4
376400
if: "ctx.source?.ip != null && ctx.source?.ip.contains('.')"
377401
- set:
402+
tag: set_network_type_ff656ae2
378403
field: network.type
379404
value: ipv6
380405
if: "ctx.source?.ip != null && ctx.network?.type == null"
381406
- set:
407+
tag: set_event_action_71eb8b93
382408
field: event.action
383409
value: deny
384410
if: "ctx._temp_?.event?.action == 'denied'"
385411
- append:
412+
tag: append_event_type_afe34446
386413
field: event.type
387414
value: denied
388415
if: "ctx.event?.action == 'deny'"
389416
- set:
417+
tag: set_event_action_6a3a5c5f
390418
field: event.action
391419
value: allow
392420
if: "ctx._temp_?.event?.action == 'permitted'"
393421
- append:
422+
tag: append_event_type_75dc8690
394423
field: event.type
395424
value: allowed
396425
if: "ctx.event?.action == 'allow'"
397426
- set:
427+
tag: set_log_level_e81fb788
398428
field: "log.level"
399429
if: "ctx.event.severity == 0"
400430
value: emergencies
401431
- set:
432+
tag: set_log_level_e663c8d8
402433
field: "log.level"
403434
if: "ctx.event.severity == 1"
404435
value: alert
405436
- set:
437+
tag: set_log_level_0f36429c
406438
field: "log.level"
407439
if: "ctx.event.severity == 2"
408440
value: critical
409441
- set:
442+
tag: set_log_level_201bba1e
410443
field: "log.level"
411444
if: "ctx.event.severity == 3"
412445
value: error
413446
- set:
447+
tag: set_log_level_4f08a3cf
414448
field: "log.level"
415449
if: "ctx.event.severity == 4"
416450
value: warning
417451
- set:
452+
tag: set_log_level_1f2f675b
418453
field: "log.level"
419454
if: "ctx.event.severity == 5"
420455
value: notification
421456
- set:
457+
tag: set_log_level_f5ee75b0
422458
field: "log.level"
423459
if: "ctx.event.severity == 6"
424460
value: informational
425461
- set:
462+
tag: set_log_level_da9bfdc1
426463
field: "log.level"
427464
if: "ctx.event.severity == 7"
428465
value: debug
@@ -459,60 +496,73 @@ processors:
459496
- organization_name
460497
ignore_missing: true
461498
- rename:
499+
tag: rename_source_as_asn_to_source_as_number_a917047d
462500
field: source.as.asn
463501
target_field: source.as.number
464502
ignore_missing: true
465503
- rename:
504+
tag: rename_source_as_organization_name_to_source_as_organization_name_f1362d0b
466505
field: source.as.organization_name
467506
target_field: source.as.organization.name
468507
ignore_missing: true
469508
- rename:
509+
tag: rename_destination_as_asn_to_destination_as_number_3b459fcd
470510
field: destination.as.asn
471511
target_field: destination.as.number
472512
ignore_missing: true
473513
- rename:
514+
tag: rename_destination_as_organization_name_to_destination_as_organization_name_814bd459
474515
field: destination.as.organization_name
475516
target_field: destination.as.organization.name
476517
ignore_missing: true
477518
478519
- gsub:
520+
tag: gsub_source_mac_328298a4
479521
field: source.mac
480522
pattern: ':'
481523
replacement: '-'
482524
ignore_missing: true
483525
- uppercase:
526+
tag: uppercase_source_mac_5b4e7be2
484527
field: source.mac
485528
ignore_missing: true
486529
487530
- append:
531+
tag: append_related_ip_8121c591
488532
field: related.ip
489533
value: "{{{source.ip}}}"
490534
allow_duplicates: false
491535
if: ctx.source?.ip != null
492536
- append:
537+
tag: append_related_ip_c1a6356b
493538
field: related.ip
494539
value: "{{{destination.ip}}}"
495540
allow_duplicates: false
496541
if: ctx.destination?.ip != null
497542
- append:
543+
tag: append_related_hosts_b0d2e007
498544
field: related.hosts
499545
value: "{{{source.domain}}}"
500546
allow_duplicates: false
501547
if: ctx.source?.domain != null
502548
- append:
549+
tag: append_related_hosts_b0d7ba0b
503550
field: related.hosts
504551
value: "{{{destination.domain}}}"
505552
allow_duplicates: false
506553
if: ctx.destination?.domain != null
507554
- append:
555+
tag: append_related_user_f745a124
508556
field: related.user
509557
value: "{{{source.user.name}}}"
510558
allow_duplicates: false
511559
if: ctx.source?.user?.name != null
512560
- community_id:
561+
tag: community_id_99f56bc8
513562
ignore_missing: true
514563
ignore_failure: true
515564
- remove:
565+
tag: remove_75b58725
516566
field:
517567
- _temp_
518568
- _conf
@@ -525,8 +575,11 @@ on_failure:
525575
ignore_missing: true
526576
- append:
527577
field: error.message
528-
value: |-
529-
Processor "{{{ _ingest.on_failure_processor_type }}}" with tag "{{{ _ingest.on_failure_processor_tag }}}" in pipeline "{{{ _ingest.on_failure_pipeline }}}" failed with message "{{{ _ingest.on_failure_message }}}"
578+
value: >-
579+
Processor '{{{ _ingest.on_failure_processor_type }}}'
580+
{{#_ingest.on_failure_processor_tag}}with tag '{{{ _ingest.on_failure_processor_tag }}}'
581+
{{/_ingest.on_failure_processor_tag}}in pipeline '{{{ _ingest.pipeline }}}'
582+
failed with message '{{{ _ingest.on_failure_message }}}'
530583
- set:
531584
field: event.kind
532585
value: pipeline_error

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.32.0"
4+
version: "1.32.1"
55
description: Collect logs from Cisco IOS with Elastic Agent.
66
type: integration
77
categories:

0 commit comments

Comments
 (0)