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
papertrail
in your state file ortop.sls
, depending on which ever you prefer.
In a state:
include:
- papertrail
in top.sls
:
base:
'*':
- papertrail
This 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.
-
files
A 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_files
A 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
-
hostname
Override the default hostname.
Example:
papertrail: hostname: my-super-awesome-hostname
-
destination_host
,destination_port
, &destination_protocol
The 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_interval
Overrides the default file check interval.
Example:
papertrail: new_file_check_interval: 30
-
severity
Overrides the default
remote_syslog2
severity level.Example:
papertrail: severity: warn
-
facility
Overrides the default
remote_syslog2
facility.Example:
papertrail: facility: local7
-
version
Use a different version of
remote_syslog
than 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-ec2
is installed:chef gem install kitchen-ec2
- Update
.kitchen.yml
to have the correct AWS key ID you're going to use - Set
security_group_ids
in the driver section to include a security group accessible from your laptop. Not setting this will use thedefault
security group. - Set
transport.ssh_key
to the path of your SSH key. It looks forid_rsa
by default.
License: See LICENSE
Author: Mike Julian (@mjulian)