GithubHelp home page GithubHelp logo

artsy / loggly-rsyslog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mveitas/loggly-rsyslog

1.0 29.0 0.0 39 KB

Chef cookbook to configure rsyslog to send logs to Loggly

License: Apache License 2.0

Ruby 92.07% HTML 7.93%

loggly-rsyslog's Introduction

Built on Travis

Loggly rsyslog Cookbook

Installs and configures rsyslog for use with Loggly. This cookbook was built upon the work from an existing cookbook, https://github.com/kdaniels/loggly-rsyslog.

Requirements

  • Chef 11 or higher
  • Ruby 1.9.3 or higher

Platform

Tested against Ubuntu 12.04

Data Bags

By default, this cookbook depends on the use of encrypted data bags to store the token to be used. For more information about data bags see the Chef Data Bags documentation. By default, the data bag needs to be named loggly and contains an item token:

{
    "id": "token",
    "token": "<your token goes here>"
}

You may change the name of the data bag and item via the node['loggly']['token']['databag'] and node['loggly']['token']['databag_item'] attributes respectively. Also, if you do not want this cookbook to load the credentials for you, and instead want to set them yourself, set node['loggly']['token']['from_databag'] to false, and then set the credentials via node['loggly']['token']['value'].

Attributes

  • node['loggly']['tags'] - A list of event tags to apply to a message (https://www.loggly.com/docs/tags/) (optional)

  • node['loggly']['log_files'] - A list of files rsyslog should monitor. (optional). Below is an example of a hash used to describe a file to monitor.

      {
          :filename => "/var/log/filename.log",
          :tag => "tag you want for this logfile",
          :statefile => "unique-name-for-statefile"
      }
    
  • node['loggly']['log_dirs'] - A list of directories to monitor (optional). The loggly configuration template will create an imfile block for each file ending in '.log' in that directory. Each logdir in the list is of the format:

    {
        :directory => "/var/log/directory",
        :tag => "tag for all files in this directory"
    }
    
  • node['loggly']['tls']['enabled'] - Set to true if communication to the remote service should use TLS (defaults to true)

  • node['loggly']['tls']['cert_path'] - Directory where the loggly certificate should be placed

  • node['loggly']['tls']['cert_url'] - Url to the loggly.com certificate

  • node['loggly']['tls']['cert_checksum'] - Cchecksum of the loggly.com certificate

  • node['loggly']['tls']['intermediate_cert_url'] - Url to the intermediate certificate

  • node['loggly']['tls']['intermediate_cert_checksum'] - Checksum of the intermediate certificate

  • default['loggly']['token']['from_databag'] - Whether to load the Loggly token from a Data Bag (defaults to true)

  • default['loggly']['token']['databag'] - The name of the Data Bag to load the credentials from (defaults to "loggly")

  • default['loggly']['token']['databag_item'] - The name of the Data Bag Item to load the credentials from (defaults to "token")

  • default['loggly']['token']['value'] - The Loggly token. Set from the Data Bag above by default.

  • node['loggly']['rsyslog']['conf'] - Name of the loggly rsyslog confiugration file (defaults to /etc/rsyslog.d/10-loggly.conf)

  • node['loggly']['rsyslog']['host'] - Name of the remote loggly syslog host (defaults to logs-01.loggly.com)

  • node['loggly']['rsyslog']['port'] - Port of the remote loggly syslog host (defaults to 514 and if TLS is enabled to 6514)

  • node['loggly']['rsyslog']['input_file_poll_interval'] - Specifies how often files are to be polled for new data (defaults to 10)

Recipes

Include the default recipe in the run list or a cookbook. The cookbook includes the rsyslog cookbook that will install the rsyslog package and start the service if it does not exist. The rsyslog service will restart after changes to the loggly rsyslog configuration file are made.

Running Locally with Vagrant

Since the cookbook relies on using an encrypted data bag, there is some additional steps that are needed in order to run the cookbook locally using Vagrant. The create_data_bag.rb is a helper script that can be used to create the data bag for loggly for use with Vagrant and Chef Solo. The script expects a single arguement, the value of the loggly token.

Add the following two lines into your Vagrantfile in the chef_solo provisioner configuration:

chef.data_bags_path = './data_bags'
chef.encrypted_data_bag_secret_key_path = './encrypted_data_bag_secret'

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.

loggly-rsyslog's People

Contributors

mveitas avatar motns avatar

Stargazers

Daniel (dB.) Doubrovkine avatar

Watchers

Joey Aghion avatar Orta Therox avatar Damon avatar Anandaroop Roy avatar Oksana avatar Daniel (dB.) Doubrovkine avatar Craig Spaeth avatar Alexander Fabry avatar Mykola Bilokonsky avatar Caroline Lau avatar Sepand Ansari avatar Devang Thakkar avatar Chung-Yi Chi avatar Charles Broskoski avatar James Cloos avatar Brian Watterson avatar Ashkan Nasseri avatar Matt Zikherman avatar Daniel Levenson avatar  avatar Sarah Weir avatar  avatar Justin Bennett avatar Lily Pace avatar Samuel Rozenberg avatar Lance Wakeling avatar Oliver Plunkett avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.