salt.returners.syslog_return

Return data to the host operating system's syslog facility

To use the syslog returner, append '--return syslog' to the salt command.

salt '*' test.ping --return syslog

The following fields can be set in the minion conf file:

syslog.level (optional, Default: LOG_INFO)
syslog.facility (optional, Default: LOG_USER)
syslog.tag (optional, Default: salt-minion)
syslog.options (list, optional, Default: [])

Available levels, facilities, and options can be found in the syslog docs for your python version.

Note

The default tag comes from sys.argv[0] which is usually "salt-minion" but could be different based on the specific environment.

Configuration example:

syslog.level: 'LOG_ERR'
syslog.facility: 'LOG_DAEMON'
syslog.tag: 'mysalt'
syslog.options:
  - LOG_PID

Of course you can also nest the options:

syslog:
  level: 'LOG_ERR'
  facility: 'LOG_DAEMON'
  tag: 'mysalt'
  options:
    - LOG_PID

Alternative configuration values can be used by prefacing the configuration. Any values not found in the alternative configuration will be pulled from the default location:

alternative.syslog.level: 'LOG_WARN'
alternative.syslog.facility: 'LOG_NEWS'

To use the alternative configuration, append --return_config alternative to the salt command.

New in version 2015.5.0.

salt '*' test.ping --return syslog --return_config alternative

To override individual configuration items, append --return_kwargs '{"key:": "value"}' to the salt command.

New in version 2016.3.0.

salt '*' test.ping --return syslog --return_kwargs '{"level": "LOG_DEBUG"}'

Note

Syslog server implementations may have limits on the maximum record size received by the client. This may lead to job return data being truncated in the syslog server's logs. For example, for rsyslog on RHEL-based systems, the default maximum record size is approximately 2KB (which return data can easily exceed). This is configurable in rsyslog.conf via the $MaxMessageSize config parameter. Please consult your syslog implmentation's documentation to determine how to adjust this limit.

salt.returners.syslog_return.prep_jid(nocache=False, passed_jid=None)

Do any work necessary to prepare a JID, including sending a custom id

salt.returners.syslog_return.returner(ret)

Return data to the local syslog

© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/returners/all/salt.returners.syslog_return.html