.. _vyos.rest.vyos_logging_global_module: ***************************** vyos.rest.vyos_logging_global ***************************** **Manage syslog configuration on VyOS devices using REST API** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Manages syslog (logging) configuration on VyOS devices via the REST API. - Supports console, file, host, user, and global logging targets with per-target facility and severity configuration. - Uses REST API (``connection=httpapi``) instead of CLI. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
dictionary
Logging configuration.
console
dictionary
Logging to serial console.
facilities
list / elements=dictionary
List of syslog facilities to log to the console.
facility
string
Syslog facility name (e.g. local7, all, kern).
severity
string
Minimum severity level to log (e.g. err, debug, all).
files
list / elements=dictionary
Logging to local files.
archive
dictionary
Log file archive/rotation settings.
file_num
integer
Number of archived log files to keep.
size
integer
Maximum size of log file in kilobytes before rotation.
facilities
list / elements=dictionary
List of syslog facilities to log to this file.
facility
string
Syslog facility name.
severity
string
Minimum severity level to log.
path
string
Path to the log file on the device.
global_params
dictionary
Global syslog parameters (maps to system syslog global).
archive
dictionary
Global log archive/rotation settings.
file_num
integer
Number of archived log files to keep.
size
integer
Maximum size of log file in kilobytes before rotation.
facilities
list / elements=dictionary
List of syslog facilities for global logging.
facility
string
Syslog facility name.
severity
string
Minimum severity level to log.
marker_interval
integer
Interval in seconds between marker log entries.
preserve_fqdn
boolean
    Choices:
  • no
  • yes
Use the fully qualified domain name in syslog messages.
hosts
list / elements=dictionary
Logging to remote syslog hosts.
facilities
list / elements=dictionary
List of syslog facilities to forward to this host.
facility
string
Syslog facility name.
protocol
string
Per-facility protocol override (udp or tcp).
severity
string
Minimum severity level to forward.
hostname
string
IP address or hostname of the remote syslog server.
port
integer
UDP/TCP port on the remote syslog server (default 514).
protocol
string
Transport protocol (udp or tcp).
users
list / elements=dictionary
Logging to local user terminals.
facilities
list / elements=dictionary
List of syslog facilities to send to this user.
facility
string
Syslog facility name.
severity
string
Minimum severity level to send.
username
string
Local username whose terminal receives log messages.
running_config
string
Used only with state parsed.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
  • rendered
  • parsed
Desired state of the logging configuration.

Examples -------- .. code-block:: yaml - name: Merge logging configuration vyos.rest.vyos_logging_global: config: console: facilities: - facility: local7 severity: err files: - path: logFile archive: file_num: 2 facilities: - facility: local6 severity: emerg hosts: - hostname: 172.16.0.1 port: 223 facilities: - facility: local7 severity: all - facility: all protocol: udp users: - username: vyos facilities: - facility: local7 severity: debug global_params: archive: file_num: 2 size: 111 facilities: - facility: cron severity: debug marker_interval: 111 preserve_fqdn: true state: merged - name: Delete all logging configuration vyos.rest.vyos_logging_global: state: deleted - name: Gather current logging configuration vyos.rest.vyos_logging_global: state: gathered Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
dictionary
when changed
Logging configuration after this module ran.

before
dictionary
when state is merged, replaced, overridden or deleted
Logging configuration before this module ran.

commands
list
always
List of API command tuples sent to the device.

gathered
dictionary
when state is gathered
Current logging configuration from the device.

saved
dictionary
when changes are applied
Result of save_config after applying changes.



Status ------ Authors ~~~~~~~ - Sagar Paul (@KB-perByte)