Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

loggly_rsyslog_ng (6) Versions 5.0.0

LWRP for configuring rsyslog to send data to Loggly

Policyfile
Berkshelf
Knife
cookbook 'loggly_rsyslog_ng', '= 5.0.0', :supermarket
cookbook 'loggly_rsyslog_ng', '= 5.0.0'
knife supermarket install loggly_rsyslog_ng
knife supermarket download loggly_rsyslog_ng
README
Dependencies
Changelog
Quality 0%

Loggly rsyslog LWRP

Migration to version 5

  • Recently I released version 5 of loggly_rsyslog_ng cookbook.
  • Resourse attributes were changed, so cookbook that use loggly_rsyslog_ng resource should be amended correspondingly.
  • Major change - loggly resource defines one file to log. If you don't like that send PRs/Issues at github.
  • Please send issues at github if you have any problems with this version.
  • Changes are in CHANGELOG file.

Requirements

  • Chef 11 or higher
  • Ruby 2.0.0 or higher
  • rsyslog 5.6.x or higher (rsyslog 5.6.x support will be deprecated soon in favour of rsyslog 7.6.x+)

Platform

Tested against Debian 7

Usage

loggly_rsyslog_ng 'mylog' do
  log_filename      '/var/log/myapp.log'
  loggly_token      'my_very_secret_token'
  loggly_tags        [ node.chef_environment ]
  rsyslog_selector   ':syslogtag, isequal, "mylog:"'
  rsyslog_tag        'mylog'
end

Notes

mylog is a name of loggly's resource. It's recommended to choose uniq name for each log resource.

Resources

default

  • name - resource name. Should be uniq. Used for generation uniq parameters inside loggly_rsyslog_ng provider.
  • log_filename - log file full path. Resource will add monitoring of this exact file.
  • log_owner - in case that logfile isn't exist yet - loggly_rsyslog_ng will create one with no content and log_owner owner.
  • log_group - in case that logfile isn't exist yet - loggly_rsyslog_ng will create one with no content and log_group group.
  • loggly_token - The Loggly token.
  • loggly_tls_certs_install - should resource install loggly tls certificate or not. By default it's true.
  • loggly_tls_name - file name for loggly tls certificate. by default it's rsyslog.loggly.crt.
  • loggly_tls_path - path to loggly tls certificate. by default it's /etc/rsyslog.d/keys/ca.d.
  • loggly_tags - A list of event tags to apply to a message (https://www.loggly.com/docs/tags/) (optional).
  • loggly_host - Loggly host. by default it's: logs-01.loggly.com.
  • loggly_port - Loggly port. by default it's 6514 if TLS enabled and 514 otherwise.
  • rsyslog_config - rsyslog local file config name. By default it's /etc/rsyslog.d/22-loggly-_name_.conf.
  • rsyslog_install - shoud resource install rsyslog or not. by default it's true.
  • rsyslog_tls_enable - enable or disable TLS. by default it's true.
  • rsyslog_ruleset - rsyslog ruleset. by default it's the same as name.
  • rsyslog_tag - rsyslog tag. by default it's the same as name.
  • rsyslog_selector - rsyslog selector. by default it's *.*.
  • rsyslog_imfile_module - should resource enable imfile rsyslog module. by default it's true.

tls

  • cert_name - Certificate local file name. Should be specified. Name attribute.
  • cert_from_file - If true gets loggly SSL certificates from cookbook files directory. if false download them from loggly website. by default it's true
  • cert_url - Url to the loggly.com certificate
  • intermediate_cert_url - Url to the intermediate certificate
  • cert_checksum - Cchecksum of the loggly.com certificate
  • intermediate_cert_checksum - Checksum of the intermediate certificate

Tests

  • This cookbook has Test Kitchen config to test chef-run with this LWRP for errors. No integration tests yet.
  • The default .kitchen.yml assumes that you are testing using vagrant driver, you will need Vagrant and Virtualbox installed.

To run converge, execute command:

 kitchen converge

Important! Secure attributes and integration testing

Cookbooks contains secure attributes, that shouldn't be exposed in the git repository.

To start Test Kitchen you should set these environment variables:

  • LOGGLY_TOKEN - Loggly API token.

License & Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

apt >= 0.0.0
rsyslog >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

loggly_rsyslog_ng Cookbook CHANGELOG

This file is used to list changes made in each version of the loggly_rsyslog_ng cookbook.

v5.0.0

  • Add: rainerscript config for rsyslog 7.6.x+
  • Modify: from now on all major enhancements will be performed for rsyslog 7.6.x+ version of configs. Older rsyslog 5.8.x config format will be supported in legacy mode.
  • Add: setting a names for action queues
  • Add: separate main queue for each log that we send to loggly
  • Add: disk assisted action queue for every added action.
  • Add: creates log file and directory if it doesn't exist
  • Modify: now resource will define logging for only one file.
  • Modify: some attributes names for better clarity.
  • Remove: support of facilities, I'll use different rulesets, so facilities is not neccessary

v4.3.0

  • Add: test-kitchen setup for AWS and fixture cookbook for testing LWRP
  • Fix: calling loggy_rsyslog_ng_tls provider inside loggy_rsyslog_ng provider

v4.2.0

  • Add: installing loggly certificate from file by default. network connection is not reliable.

v4.1.0

  • Add: optional facility opgion go log_file and log_dir hashes.

v4.0.0

  • Modify: rewrite the cookbook as LWRP

v3.0.0

  • Modify: fork cookbook from loggly-rsyslog cookbook
  • Modify: cookbook name, from loggly-rsyslog to loggly_rsyslog_ng to avoid name collisions
  • Fix: checksum for loggly SSL certificate

v2.0.0

  • Use an encrypted databag to retrieve the loggly token instead of a node attribute

v1.0.1

  • Set rsyslog configuration values to be configurable via attributes

v1.0.0 (1/25/2014)

  • Initial cookbook version
  • Support for sending messages using TLS
  • Configuration for monitoring a list of files
  • Configuration for monitoring a list of directories

Foodcritic Metric
            

5.0.0 failed this metric

FC021: Resource condition in provider may not behave as expected: /tmp/cook/bb3cc39c723e79f4d310195a/loggly_rsyslog_ng/providers/default.rb:47
FC021: Resource condition in provider may not behave as expected: /tmp/cook/bb3cc39c723e79f4d310195a/loggly_rsyslog_ng/providers/default.rb:80
FC023: Prefer conditional attributes: /tmp/cook/bb3cc39c723e79f4d310195a/loggly_rsyslog_ng/providers/default.rb:54