Semi-official Logstash cookbook
Ruby Shell HTML
Latest commit d4c2749 Jun 12, 2017 1 @martinb3 martinb3 Release v1.0.0
Permalink
Failed to load latest commit information.
attributes removes unused attributes (#469) Jun 8, 2017
files/default empty threats and broken promises Nov 29, 2014
libraries Fix #432 Jun 1, 2017
providers renames internal attribute name from `method` to `init_method` (#472) Jun 10, 2017
recipes replaces python cookbook(depricated) with poise-python (#466) Jun 8, 2017
resources renames internal attribute name from `method` to `init_method` (#472) Jun 10, 2017
templates/default Fix #432 Jun 1, 2017
test fixes chef13 deprecation warnings (#476) Jun 10, 2017
.foodcritic Fix lint problems May 31, 2017
.gitignore fixes for service_restart Aug 31, 2014
.kitchen.yml Chef13 support Jun 12, 2017
.rubocop.yml Fix bad merge Jun 1, 2017
.ruby-version Get tests passing on Chef 12.7 May 31, 2017
.travis.yml Get tests passing on Chef 12.7 May 31, 2017
Berksfile adds ‘java’ cookbook to integration cookbooks (#475) Jun 10, 2017
CHANGELOG.md Release v1.0.0 Jun 12, 2017
CONTRIBUTORS Redirect STDOUT to /dev/null on restart by logrotate. Jun 1, 2017
Gemfile Chef13 support Jun 12, 2017
Guardfile use pleaserun for services, cleanup of testing, remove zeromq/rabbit … Mar 16, 2014
LICENSE Fix lint problems May 31, 2017
README.md removes Vagrant leftovers from README.md (#474) Jun 10, 2017
Rakefile Fix lint problems May 31, 2017
Strainerfile cleanup of testing environment Jan 11, 2014
chefignore adding some ignores and updating contributors Jul 9, 2013
metadata.rb Release v1.0.0 Jun 12, 2017

README.md

chef-logstash Build Status

Description

This is the semi-official 'all-in-one' Logstash cookbook.

This cookbook is primarily a library cookbook.

While you can still use the agent and server recipes, they are not recommended as they are very limited in what they do.

If you are using logstash < 1.2 you might want to use the 0.6.x branch. If you are using logstash < 1.4 you might want to use the 0.7.x branch.

Requirements

All of the requirements are explicitly defined in the recipes. Every effort has been made to utilize Community Cookbooks.

However if you wish to use an external ElasticSearch cluster, you will need to install that yourself and change the relevant attributes for discovery. The same applies to integration with Graphite.

This cookbook has been tested together with the following cookbooks, see the Berksfile for more details

Attributes

Default

see attributes/default.rb

Beaver (alternative to Logstash Agent)

no longer used. see Community Beaver cookbook

Source

no longer supports installing from source.

Lightweight Resource Providers

These now do all the heavy lifting.

logstash_instance

This will install a logstash instance. It will take defaults from attributes for most attributes.

see resources/instance.rb

logstash_service

This will create system init scripts for managing logstash instance. It will take defaults from attributes for most attributes.

see resources/service.rb

experimental support for pleaserun has been added. Only native for Ubuntu 12.04 has been thoroughly tested.

logstash_config

This will create logstash config files. It will take defaults from attributes for most attributes.

see resources/config.rb

logstash_pattern

This will install custom grok patterns for logstash. It will take defaults from attributes for most attributes:

see resources/pattern.rb

logstash_plugins

This will install the logstash community plugins:

see resources/plugins.rb

logstash_curator

This will install the ElasticSearch Curator and setup a cron job. This replaces the deprecated index_cleaner:

see resources/curator.rb

attribute precidence in logstash LWRPs

We've done our best to make this intuitive and easy to use.

  1. the value directly in the resource block.
  2. the value from the hash node['logstash']['instance'][name]
  3. the value from the hash node['logstash']['instance_default']

You should be able to override settings in any of the above places. It is recommended for readability that you set non-default options in the LWRP resource block. But do whichever makes sense to you.

Searching

There is a search helper library libraries/search.rb which will help you search for values such as elasticsearch_ip. see the server recipe for an example of its usage.

Testing

Rubocop, FoodCritic, Rspec, Test-Kitchen

$ bundle exec rake

Test Kitchen

$ kitchen converge server_ubuntu

Contributing

Any and all contributions are welcome. We do ask that you test your contributions with the testing framework before you send a PR. All contributions should be made against the master branch.

Please update tests and changelist with your contributions.

Documentation contributions will earn you lots of hugs and kisses.

Usage

A proper readme is forthcoming but in the interim....

These two recipes show how to install and configure logstash instances via the provided LWRPs

See the elkstack community cookbook for a great example of using the LWRPs provided by this cookbook.

License and Author

  • Author: John E. Vincent
  • Author: Bryan W. Berry (bryan.berry@gmail.com)
  • Author: Richard Clamp (@richardc)
  • Author: Juanje Ojeda (@juanje)
  • Author: @benattar
  • Author: Paul Czarkowski (@pczarkowski)
  • Copyright: 2012, John E. Vincent
  • Copyright: 2012, Bryan W. Berry
  • Copyright: 2012, Richard Clamp
  • Copyright: 2012, Juanje Ojeda
  • Copyright: 2012, @benattar
  • Copyright: 2014, Paul Czarkowski

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.