This formula configures the Papertrail remote_syslog2 agent. To configure rsyslog for use with Papertrail, check out the Papertrail documentation.
- RHEL 6 / CentOS 6
- RHEL 7 / CentOS 7
- Amazon Linux 2017.03
- Ubuntu 14.04
- Ubuntu 16.04
- Debian 9
- Set the pillar attributes
papertrail.destination_host,papertrail.destination_port, and at least one file/directory infiles.
papertrail:
files:
- /var/log/syslog
- /var/log/apache2/*.log
destination_host: logsN.papertrailapp.com
destination_port: XXXXX- Include
papertrailin your state file ortop.sls, depending on which ever you prefer.
In a state:
include:
- papertrailin top.sls:
base:
'*':
- papertrailThis will install remote_syslog2 with the configured settings from Pillar.
This Salt formula only has one state, which does all setup and configuration. There are a number of Pillar items you can configure, all of which mirror the configuration items found in the remote_syslog2 README.
-
filesA list of files or patterns to send to Papertrail.
Example:
papertrail: files: - /tmp/test.log - /srv/foo.txt - /var/log/*.bar - path: /srv/foo.txt tag: foo_file
-
exclude_filesA list of files or patterns to exclude.
Example:
papertrail: exclude_files: - /tmp/exlude.log - /srv/dont-include.log - /var/log/skip-me.log
-
exclude_patterns:A regex of log message patterns to exclude.
Example:
papertrail: exclude_patterns: - \d+ things
-
hostnameOverride the default hostname.
Example:
papertrail: hostname: my-super-awesome-hostname
-
destination_host,destination_port, &destination_protocolThe Papertrail host and port to send logs to, and the protocol to use. These are required. Protocol defaults to
tls.Example:
papertrail: destination_host: logsN.papertrailapp.com destination_port: XXXXX destination_protocol: tls
-
new_file_check_intervalOverrides the default file check interval.
Example:
papertrail: new_file_check_interval: 30
-
severityOverrides the default
remote_syslog2severity level.Example:
papertrail: severity: warn
-
facilityOverrides the default
remote_syslog2facility.Example:
papertrail: facility: local7
-
versionUse a different version of
remote_syslogthan the default. The default is specified inmap.jinja.Example:
papertrail: version: 0.18
No unit tests exist at this time.
- Run
kitchen test - Take a break--it takes a bit to run the full suite.
The pillar test data is located in test-pillar.yaml.
Testing Amazon Linux through test-kitchen requires a bit more setup:
- Ensure
kitchen-ec2is installed:chef gem install kitchen-ec2 - Update
.kitchen.ymlto have the correct AWS key ID you're going to use - Set
security_group_idsin the driver section to include a security group accessible from your laptop. Not setting this will use thedefaultsecurity group. - Set
transport.ssh_keyto the path of your SSH key. It looks forid_rsaby default.
License: See LICENSE
Author: Mike Julian (@mjulian)