GithubHelp home page GithubHelp logo

whilp / chef_logstash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scalp42/chef_logstash

0.0 3.0 0.0 346 KB

Chef Cookbook with Resource Providers to manage Logstash

License: Apache License 2.0

Ruby 100.00%

chef_logstash's Introduction

Notice

This cookbook is under active development, and its public interface may change.

What this warning means is that the attributes, and actions used by logstash_instance and logstash_config may drastically change. When using this cookbook please reference an exact SHA commit from this repository to ensure continuous functionality.

chef_logstash cookbook

This is a Library Style cookbook that provides Chef Resource Providers to create and manage your Logstash environment.

Requirements

The following cookbooks are suggested to use this cookbook:

Usage

Resources and Providers

logstash_instance

The intention is to provide a stable interface to creating instances of Logstash on your servers. This means creating a instance via logstash_instance will download, install, and setup a functional instance of Logstash but it does not handle any configuration details.

The following actions are supported and :create is the default:

  • :create - Creates a named instance of Logstash. This action will download logstash :version to the :dst_dir. It creates the :user and :group used to run Logstash. And finally it creates the runit resource required to manage the service. It does not start the service as that is a job for :enable.

  • :enable - Enables the specified service_type or the default init.

  • :update -

  • :destroy -

  • :nothing -

These attributes are defined in the resource:

  • name
  • user
  • group
  • conf_dir
  • dst_dir
  • service_type -
  • service_options -
  • install_type -
  • install_options -

Usage example:

logstash_instance 'default' do
  install_options({
    url:      node.logstash.install_options.fetch(:url),
    checksum: node.logstash.install_options.fetch(:checksum),
    version:  node.logstash.install_options.fetch(:version)
  })
  action   [:create, :enable]
end

logstash_config

The following actions are supported and :create is the default:

  • :create - Creates a named configuration for a specific Logstash plugin. This action will create a sub-resource based on the plugin_type and plugin specified. The plugin_config attribute will be passed to the sub-resource during resource creation. We use the instance attribute to link this configuration to a specific Logstash instance.
  • :enable - Ensures the configuration for the specified instance has been loaded.
  • :update -
  • :destroy - Remove the named configuration.
  • :nothing - Does nothing, except define the resource with the associated attributes.

These attributes are defined in the resource:

  • instance - The Logstash instance this plugin is associated with.
  • plugin - One of the numerous Logstash plugins.
  • plugin_type - Accepts one of 'input', 'filter', 'output'
  • plugin_config- A hash containing the key-value pairs that configure the plugin.

Usage example:

logstash_config 'httpd_log_files' do
  instance    'default'
  plugin      'file'
  plugin_type 'input'
  plugin_config({
    path: ['/var/log/httpd/*_log'],
    type: 'httpd'
  })
  action [:create, :enable]
end

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_changes)
  3. Commit your changes (git commit -am "Added Snark")
  4. Push to the branch (git push origin my_changes)
  5. Open a Pull Request
  6. Enjoy a refreshing Slurm and wait

Testing

Build Status Code Climate Coverage Status

Code Style

This code follows the Ruby Style Guide and all contributions should as well.

The code style is checked by Rubocop and can be checked by executing rake test:rubocop or rubocop.

Author

Author:: Miah Johnson ([email protected])

Donations

Gittip

Bitcoin

License

Copyright 2013 Miah Johnson

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.

chef_logstash's People

Contributors

electrical avatar miah avatar

Watchers

 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.