From b108b31cdae0a064c4c24960081f1ac2e58a33c9 Mon Sep 17 00:00:00 2001 From: durd Date: Mon, 27 Nov 2023 19:47:07 +0000 Subject: [PATCH 1/9] Add template for rfc5424 logging --- .../avd/roles/eos_cli_config_gen/templates/eos/logging.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/logging.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/logging.j2 index 33c30d091de..65609c54a01 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/logging.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/logging.j2 @@ -71,6 +71,9 @@ logging format hostname ipv4 {% if logging.format.sequence_numbers is arista.avd.defined(true) %} logging format sequence-numbers {% endif %} +{% if logging.format.rfc5424 is arista.avd.defined(true) %} +logging format rfc5424 +{% endif %} {% if logging.facility is arista.avd.defined %} logging facility {{ logging.facility }} {% endif %} From c3a6e149d0f550cd9adb27cd5c19c5d368507ffa Mon Sep 17 00:00:00 2001 From: durd Date: Mon, 27 Nov 2023 20:13:02 +0000 Subject: [PATCH 2/9] Add documenation for logging format rfc5424 --- .../avd/roles/eos_cli_config_gen/docs/tables/logging.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/logging.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/logging.md index f1a20e1b680..29738ae5859 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/logging.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/logging.md @@ -20,6 +20,7 @@ | [    timestamp](## "logging.format.timestamp") | String | | | Valid Values:
- high-resolution
- traditional
- traditional timezone
- traditional year
- traditional timezone year
- traditional year timezone | Timestamp format | | [    hostname](## "logging.format.hostname") | String | | | Valid Values:
- fqdn
- ipv4 | Hostname format in syslogs. For hostname _only_, remove the line. (default EOS CLI behaviour). | | [    sequence_numbers](## "logging.format.sequence_numbers") | Boolean | | | | Add sequence numbers to log messages
| + | [    rfc5424](## "logging.format.rfc5424") | Boolean | | | | Forward logs in RFC5424 format
| | [  facility](## "logging.facility") | String | | | Valid Values:
- auth
- cron
- daemon
- kern
- local0
- local1
- local2
- local3
- local4
- local5
- local6
- local7
- lpr
- mail
- news
- sys9
- sys10
- sys11
- sys12
- sys13
- sys14
- syslog
- user
- uucp | | | [  source_interface](## "logging.source_interface") | String | | | | Source Interface Name | | [  vrfs](## "logging.vrfs") | List, items: Dictionary | | | | | @@ -73,6 +74,9 @@ # Add sequence numbers to log messages sequence_numbers: + + # Forward logs in RFC5424 format + rfc5424: facility: # Source Interface Name From 9895fddf44173c770f8c4f407fff067b0e4f32f2 Mon Sep 17 00:00:00 2001 From: durd Date: Mon, 27 Nov 2023 20:13:30 +0000 Subject: [PATCH 3/9] Add logging format rfc5424 to schema --- .../schemas/eos_cli_config_gen.jsonschema.json | 5 +++++ .../eos_cli_config_gen/schemas/eos_cli_config_gen.schema.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json index 344e3bd399e..1d740c7e06e 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json @@ -7680,6 +7680,11 @@ "type": "boolean", "description": "Add sequence numbers to log messages\n", "title": "Sequence Numbers" + }, + "rfc5424": { + "type": "boolean", + "description": "Forward logs in RFC5424 format\n", + "title": "RFC5424" } }, "additionalProperties": false, diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.schema.yml b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.schema.yml index e5c2032a9f6..e3df97debce 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.schema.yml +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.schema.yml @@ -4507,6 +4507,11 @@ keys: type: bool description: 'Add sequence numbers to log messages + ' + rfc5424: + type: bool + description: 'Forward logs in RFC5424 format + ' facility: type: str From 57cde2fcfba6344df844d2f408b6ec8ebdb6a095 Mon Sep 17 00:00:00 2001 From: durd Date: Mon, 27 Nov 2023 20:13:45 +0000 Subject: [PATCH 4/9] Add logging format rfc5424 to schema --- .../schemas/schema_fragments/logging.schema.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/logging.schema.yml b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/logging.schema.yml index bf02db4ab2d..b003dfb91ee 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/logging.schema.yml +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/schema_fragments/logging.schema.yml @@ -62,6 +62,10 @@ keys: type: bool description: | Add sequence numbers to log messages + rfc5424: + type: bool + description: | + Forward logs in RFC5424 format facility: type: str valid_values: ["auth", "cron", "daemon", "kern", "local0", "local1", "local2", "local3", "local4", From 4da19f6767c76dff21831536ad0cb589cc45e4b7 Mon Sep 17 00:00:00 2001 From: durd Date: Mon, 27 Nov 2023 20:14:21 +0000 Subject: [PATCH 5/9] Add documentation for logging format rfc5424 --- .../eos_cli_config_gen/templates/documentation/logging.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/logging.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/logging.j2 index 8f83c9b8064..e17a85c3bc7 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/logging.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/logging.j2 @@ -44,6 +44,11 @@ {% else %} | Sequence-numbers | false | {% endif %} +{% if logging.format.rfc5424 is arista.avd.defined(true) %} +| RFC5424 | true | +{% else %} +| RFC5424 | false | +{% endif %} {% endif %} {% if logging.vrfs is arista.avd.defined %} From 86051c314abd321f3a813f11c0798901e3003671 Mon Sep 17 00:00:00 2001 From: David Brodin Date: Wed, 29 Nov 2023 13:17:16 +0000 Subject: [PATCH 6/9] Upload artefact for issue #3366 --- .../eos_cli_config_gen/documentation/devices/logging.md | 2 ++ .../eos_cli_config_gen/intended/configs/logging.cfg | 1 + .../eos_cli_config_gen/inventory/host_vars/logging.yml | 1 + .../avd/roles/eos_cli_config_gen/templates/eos/logging.j2 | 6 +++--- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/logging.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/logging.md index 2873ffb8a51..973be3910f4 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/logging.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/logging.md @@ -53,6 +53,7 @@ interface Management1 | Timestamp | traditional year timezone | | Hostname | hostname | | Sequence-numbers | false | +| RFC5424 | true | | VRF | Source Interface | | --- | ---------------- | @@ -87,6 +88,7 @@ logging vrf mgt host 30.30.30.7 100 200 protocol tcp logging vrf mgt host 40.40.40.7 300 400 logging vrf vrf_with_no_source_interface host 1.2.3.4 logging format timestamp traditional year timezone +logging format rfc5424 logging source-interface Loopback0 logging vrf mgt source-interface Management0 ``` diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/logging.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/logging.cfg index e5dfbe2301f..4455ee0ac0c 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/logging.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/logging.cfg @@ -16,6 +16,7 @@ logging vrf mgt host 30.30.30.7 100 200 protocol tcp logging vrf mgt host 40.40.40.7 300 400 logging vrf vrf_with_no_source_interface host 1.2.3.4 logging format timestamp traditional year timezone +logging format rfc5424 logging source-interface Loopback0 logging vrf mgt source-interface Management0 ! diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/logging.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/logging.yml index 73e6e6da198..2285d8889d8 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/logging.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/logging.yml @@ -9,6 +9,7 @@ logging: level: format: timestamp: traditional year timezone + rfc5424: true source_interface: vrfs: - name: mgt diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/logging.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/logging.j2 index 65609c54a01..21c2f2629ea 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/logging.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/logging.j2 @@ -63,6 +63,9 @@ logging synchronous level {{ logging.synchronous.level | arista.avd.default("cri {% if logging.format.timestamp is arista.avd.defined %} logging format timestamp {{ logging.format.timestamp }} {% endif %} +{% if logging.format.rfc5424 is arista.avd.defined(true) %} +logging format rfc5424 +{% endif %} {% if logging.format.hostname is arista.avd.defined('fqdn') %} logging format hostname fqdn {% elif logging.format.hostname is arista.avd.defined('ipv4') %} @@ -71,9 +74,6 @@ logging format hostname ipv4 {% if logging.format.sequence_numbers is arista.avd.defined(true) %} logging format sequence-numbers {% endif %} -{% if logging.format.rfc5424 is arista.avd.defined(true) %} -logging format rfc5424 -{% endif %} {% if logging.facility is arista.avd.defined %} logging facility {{ logging.facility }} {% endif %} From 0b5344337d400a0dcb9e2e5e92a31ddf23e2cb39 Mon Sep 17 00:00:00 2001 From: David Brodin Date: Wed, 29 Nov 2023 14:33:14 +0000 Subject: [PATCH 7/9] Capitalization --- .../schemas/eos_cli_config_gen.jsonschema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json index 1d740c7e06e..0e999075383 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/schemas/eos_cli_config_gen.jsonschema.json @@ -7684,7 +7684,7 @@ "rfc5424": { "type": "boolean", "description": "Forward logs in RFC5424 format\n", - "title": "RFC5424" + "title": "Rfc5424" } }, "additionalProperties": false, From 0fb271f9a269f2c514c88ca41cf9a3a462679015 Mon Sep 17 00:00:00 2001 From: Carl Buchmann Date: Fri, 1 Dec 2023 09:19:23 -0500 Subject: [PATCH 8/9] Update ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/logging.j2 Co-authored-by: Tony Reddy Goda --- .../eos_cli_config_gen/templates/documentation/logging.j2 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/logging.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/logging.j2 index e17a85c3bc7..0e3ad121b37 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/logging.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/logging.j2 @@ -44,11 +44,7 @@ {% else %} | Sequence-numbers | false | {% endif %} -{% if logging.format.rfc5424 is arista.avd.defined(true) %} -| RFC5424 | true | -{% else %} -| RFC5424 | false | -{% endif %} +| RFC5424 | {{ logging.format.rfc5424 | arista.avd.default(false) }} | {% endif %} {% if logging.vrfs is arista.avd.defined %} From 2caacff9c418132001bf935f7566bd7429733d1d Mon Sep 17 00:00:00 2001 From: Claus Holbech Date: Fri, 1 Dec 2023 15:30:42 +0100 Subject: [PATCH 9/9] Update ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/logging.md --- .../eos_cli_config_gen/documentation/devices/logging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/logging.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/logging.md index 973be3910f4..576b9a4293a 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/logging.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/logging.md @@ -53,7 +53,7 @@ interface Management1 | Timestamp | traditional year timezone | | Hostname | hostname | | Sequence-numbers | false | -| RFC5424 | true | +| RFC5424 | True | | VRF | Source Interface | | --- | ---------------- |