Skip to content

Commit

Permalink
Feat(eos_cli_config_gen): Add support for logging format rfc5424 (ari…
Browse files Browse the repository at this point in the history
…stanetworks#3386)

Co-authored-by: Tony Reddy Goda <[email protected]>
  • Loading branch information
durd and tgodaA authored Dec 1, 2023
1 parent 79240d7 commit b0c4aa9
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 0 deletions.
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

0 comments on commit b0c4aa9

Please sign in to comment.