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

Feat(eos_cli_config_gen): Add support for logging format rfc5424 #3386

Merged
merged 10 commits into from
Dec 1, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ interface Management1
| Timestamp | traditional year timezone |
| Hostname | hostname |
| Sequence-numbers | false |
| RFC5424 | True |

| VRF | Source Interface |
| --- | ---------------- |
Expand Down Expand Up @@ -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
```
Original file line number Diff line number Diff line change
Expand Up @@ -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
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ logging:
level:
format:
timestamp: traditional year timezone
rfc5424: true
source_interface:
vrfs:
- name: mgt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;timestamp</samp>](## "logging.format.timestamp") | String | | | Valid Values:<br>- <code>high-resolution</code><br>- <code>traditional</code><br>- <code>traditional timezone</code><br>- <code>traditional year</code><br>- <code>traditional timezone year</code><br>- <code>traditional year timezone</code> | Timestamp format |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;hostname</samp>](## "logging.format.hostname") | String | | | Valid Values:<br>- <code>fqdn</code><br>- <code>ipv4</code> | Hostname format in syslogs. For hostname _only_, remove the line. (default EOS CLI behaviour). |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;sequence_numbers</samp>](## "logging.format.sequence_numbers") | Boolean | | | | Add sequence numbers to log messages<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;rfc5424</samp>](## "logging.format.rfc5424") | Boolean | | | | Forward logs in RFC5424 format<br> |
| [<samp>&nbsp;&nbsp;facility</samp>](## "logging.facility") | String | | | Valid Values:<br>- <code>auth</code><br>- <code>cron</code><br>- <code>daemon</code><br>- <code>kern</code><br>- <code>local0</code><br>- <code>local1</code><br>- <code>local2</code><br>- <code>local3</code><br>- <code>local4</code><br>- <code>local5</code><br>- <code>local6</code><br>- <code>local7</code><br>- <code>lpr</code><br>- <code>mail</code><br>- <code>news</code><br>- <code>sys9</code><br>- <code>sys10</code><br>- <code>sys11</code><br>- <code>sys12</code><br>- <code>sys13</code><br>- <code>sys14</code><br>- <code>syslog</code><br>- <code>user</code><br>- <code>uucp</code> | |
| [<samp>&nbsp;&nbsp;source_interface</samp>](## "logging.source_interface") | String | | | | Source Interface Name |
| [<samp>&nbsp;&nbsp;vrfs</samp>](## "logging.vrfs") | List, items: Dictionary | | | | |
Expand Down Expand Up @@ -73,6 +74,9 @@

# Add sequence numbers to log messages
sequence_numbers: <bool>

# Forward logs in RFC5424 format
rfc5424: <bool>
facility: <str; "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 Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
{% else %}
| Sequence-numbers | false |
{% endif %}
| RFC5424 | {{ logging.format.rfc5424 | arista.avd.default(false) }} |
{% endif %}
{% if logging.vrfs is arista.avd.defined %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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') %}
Expand Down