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

filebeat (36) Versions 2.2.0

Installs/Configures Elastic Filebeat

Policyfile
Berkshelf
Knife
cookbook 'filebeat', '= 2.2.0', :supermarket
cookbook 'filebeat', '= 2.2.0'
knife supermarket install filebeat
knife supermarket download filebeat
README
Dependencies
Changelog
Quality 50%

filebeat Cookbook

Cookbook Build Status

This is a Chef cookbook to manage Filebeat.

For Production environment, always prefer the most recent release.

Most Recent Release

cookbook 'filebeat', '~> 2.2.0'

From Git

cookbook 'filebeat', github: 'vkhatri/chef-filebeat',  tag: 'v2.2.0'

Repository

https://github.com/vkhatri/chef-filebeat

Supported OS

  • Windows
  • Amazon Linux
  • CentOS
  • Fedora
  • Ubuntu
  • Debian
  • Mac OSX

Also works on Solaris zones given a physical Solaris 11.2 server. For that, use the .kitchen.zone.yml file. Check usage at (https://github.com/criticalmass/kitchen-zone). You will need an url to a filebeat package that works on Solaris 11.2. Checkout Building-Filebeat-On-Solaris11.md for instructions to build a filebeat package.

Supported Chef

  • Chef 12 (last tested on 12.21.4)

  • Chef 13 (last tested on 13.3.42)

Supported Filebeat

  • 5.x
  • 6.x

Cookbook Dependency

  • homebrew
  • elastic_repo
  • yum-plugin-versionlock
  • runit
  • windows

Recipes

  • lwrp_test - LWRP examples recipe

LWRP Resources

  • filebeat_config - filebeat configuration resource

  • filebeat_install - filebeat install resource

  • filebeat_install_preview - filebeat preview package install resource

  • filebeat_service - filebeat service resource

  • filebeat_runit_service - filebeat service resource using runit

  • filebeat_prospector - filebeat prospector resource

Limitations

The Mac OSX setup only allows for package installs and depends on brew, this means that version selection and preview build installs are not supported.

LWRP filebeat_install

LWRP filebeat_install installs filebeat, creates log/prospectors directories, and also enable filebeat service.

Below attributes are derived using helper methods and also used by other LWRP.

  • conf_dir
  • prospectors_dir
  • log_dir

LWRP example

filebeat_install 'default' do
  [options ..]
end

LWRP Options

  • action (optional) - default :create, options: :create, :delete
  • version (optional, String) - default 6.3.0, filebeat version
  • release (optional, String) - default 1, filebeat release version, used by rhel family package resource
  • setup_repo (optional, Boolean) - default true, set to false, to skip elastic repository setup using cookbook elastic_repo
  • ignore_package_version (optional, Boolean) - default false, set to true, to install latest available yum/apt filebeat package
  • service_name (optional, String) - default filebeat, filebeat service name, must be common across resources
  • disable_service (optional, Boolean) - default false, set to true, to disable filebeat service
  • notify_restart (optional, Boolean) - default true, set to false, to ignore filebeat service restart notify
  • delete_prospectors_dir (optional, Boolean) - default false, set to true, to purge prospectors directory by deleting and recrating prospectors directory
  • conf_dir (optional, String, NilClass) - default nil, filebeat configuration directory, this attribute is derived by helper method
  • prospectors_dir (optional, String, NilClass) - default nil, filebeat prospectors directory, this attribute is derived by helper method
  • log_dir (optional, String, NilClass) - default nil, filebeat log directory, this attribute is derived by helper method
  • windows_package_url (optional, String) - default auto, windows filebeat package url
  • windows_base_dir (optional, String) - default C:/opt/filebeat, filebeat windows base directory
  • apt_options (optional, Array) - default %w[stable main], filebeat package resource attribute for debian platform family
  • elastic_repo_options (optional, Hash) - default {}, resource elastic_repo options, filebeat_install attribute version overrides elasti_repo_options key version value. Check out elastic_repo cookbook for more details.

LWRP filebeat_service

LWRP filebeat_service configures filebeat service.

LWRP example

filebeat_service 'default' do
  [options ..]
end

LWRP Options

  • action (optional) - default :create, options: :create, :delete
  • filebeat_install_resource_name (optional, String) - default default, filebeat_install/filebeat_install_preview resource name, set this attribute if LWRP resource name is other than default
  • service_name (optional, String) - default filebeat, filebeat service name, must be common across resources
  • disable_service (optional, Boolean) - default false, set to true, to disable filebeat service
  • purge_prospectors_dir (optional, Boolean) - default false, set to true, to purge prospectors
  • service_ignore_failure (optional, Boolean) - default false, set to true, to ignore filebeat service failures
  • service_retries (optional, Integer) - default 2, filebeat service resource attribute
  • service_retry_delay (optional, Integer) - default 0, filebeat service resource attribute

LWRP filebeat_config

LWRP filebeat_config creates filebeat configuration yaml file /etc/filebeat/filebeat.yml.

Below filebeat configuration parameters gets overwritten by the LWRP.

  • filebeat.registry_file
  • filebeat.config_dir
  • logging.files

LWRP example

conf = {
  'filebeat.modules' => [],
  'prospectors' => [],
  'logging.level' => 'info',
  'logging.to_files' => true,
  'logging.files' => { 'name' => 'filebeat' },
  'output.elasticsearch' => { 'hosts' => ['127.0.0.1:9200'] }
}

filebeat_config 'default' do
  config conf
  action :create
end

Above LWRP Resource will create a file /etc/filebeat/filebeat.yml with content:

filebeat.modules: []
prospectors: []
logging.level: info
logging.to_files: true
logging.files:
  path: "/var/log/filebeat"
output.elasticsearch:
  hosts:
  - 127.0.0.1:9200
filebeat.registry_file: "/var/lib/filebeat/registry"
filebeat.config_dir: "/etc/filebeat/conf.d"

LWRP Options

  • action (optional) - default :create, options: :create, :delete
  • filebeat_install_resource_name (optional, String) - default default, filebeat_install/filebeat_install_preview resource name, set this attribute if LWRP resource name is other than default
  • config (Hash) - default {} filebeat configuration options
  • config_sensitive (optional, Boolean) - default false, filebeat configuration file chef resource attribute
  • service_name (optional, String) - default filebeat, filebeat service name, must be common across resources
  • conf_file (optional, String, NilClass) - default nil, filebeat configuration file, this attribute is derived by helper method
  • disable_service (optional, Boolean) - default false, set to true, to disable filebeat service
  • notify_restart (optional, Boolean) - default true, set to false, to ignore filebeat service restart notify

LWRP filebeat_prospector

LWRP filebeat_prospector creates a filebeat prospector configuration yaml file under prospectors directory with file name lwrp-prospector-#{resource_name}.yml.

LWRP example

conf = {
  'enabled' => true,
  'paths' => ['/var/log/messages'],
  'type' => 'log',
  'fields' => {'type' => 'messages_log'}
}

filebeat_prospector 'messages_log' do
  config conf
  action :create
end

Above LWRP Resource will create a file /etc/filebeat/conf.d/lwrp-prospector-messages_log.yml with content:

filebeat:
  prospectors:
  - enabled: true
    paths:
    - "/var/log/messages"
    type: log
    fields:
      type: messages_log

LWRP Options

  • action (optional) - default :create, options: :create, :delete
  • filebeat_install_resource_name (optional, String) - default default, filebeat_install/filebeat_install_preview resource name, set this attribute if LWRP resource name is other than default
  • config (Hash) - default {} filebeat configuration options
  • config_sensitive (optional, Boolean) - default false, filebeat configuration file chef resource attribute
  • service_name (optional, String) - default filebeat, filebeat service name, must be common across resources
  • disable_service (optional, Boolean) - default false, set to true, to disable filebeat service
  • notify_restart (optional, Boolean) - default true, set to false, to ignore filebeat service restart notify

LWRP filebeat_runit_service

LWRP filebeat_runit_service configures filebeat service using runit.

LWRP example

filebeat_runit_service 'default' do
  [options ..]
end

LWRP Options

  • action (optional) - default :create, options: :create, :delete
  • filebeat_install_resource_name (optional, String) - default default, filebeat_install/filebeat_install_preview resource name, set this attribute if LWRP resource name is other than default
  • service_name (optional, String) - default filebeat, filebeat service name, must be common across resources
  • disable_service (optional, Boolean) - default false, set to true, to disable filebeat service
  • purge_prospectors_dir (optional, Boolean) - default false, set to true, to purge prospectors
  • runit_filebeat_cmd_options (optional, Boolean) - default '', set to true, runit filebeat service command line options
  • service_ignore_failure (optional, Boolean) - default false, set to true, to ignore filebeat service failures

How to Create Filebeat LWRP Resources via Node Attribute

Check out filebeat test cookbook [filebeat_test](test/cookbooks/filebeat_test).

TODO

  • Add other platforms support to install_preview resource

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests (rake & rake knife), ensuring they all pass
  6. Write new resource/attribute description to README.md
  7. Write description about changes to PR
  8. Submit a Pull Request using Github

Authors:: Virender Khatri and Contributors

<pre>
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.
</pre>

Dependent cookbooks

homebrew ~> 4.2
elastic_repo >= 1.1.1
yum-plugin-versionlock >= 0.1.2
runit >= 0.0.0
windows >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

filebeat CHANGELOG

2.2.0

  • Luke Waite - Correct default file path for filebeat_config lwrp

  • Piotr Kantyka - Updated logging.files path config only when empty

  • Virender Khatri - Updated filebeat version to v6.4.2

  • Virender Khatri - Updated Kitchen Test for recent Chef Version

  • Virender Khatri - Removed v5 / Chef12 configuration references

  • Virender Khatri - Rename helper method purge_prospectors_dir to purge_prospectors_config in favor of filebeat_service resource

  • Virender Khatri - Wrapped helper methods into a module Filebeat::Helpers

2.1.0

  • Virender Khatri - Added filebeat_install attr :elastic_repo_options for :elastic_repo resource configuration

  • Virender Khatri - Added filebeat Log Directory Resource

  • Virender Khatri - Updated filebeat_service service resource

  • Virender Khatri - Updated filebeat_resource lookup to use attr filebeat_install_resource_name

  • Virender Khatri - Fixed filebeat_install for windows

  • Virender Khatri - Updated elastic_repo cookbook version

2.0.0

  • Virender Khatri - Converted Recipes to LWRP Resources, check README for available resources and test cookbook for usage reference

  • Virender Khatri - LWRP Resources uses elastic_repo cookbook to setup elastic yum/apt repository

  • Michael Burns - Clean up redundant filebeat_prospector resource attribute in test cookbook

1.5.0

  • Virender Khatri - Updated filebeat version to v6.2.4

  • Jean Rouge - Making it possible to pass additional command line arguments to the filebeat service

  • Virender Khatri - Updated tests and clean up

  • Michael Burns - Updated default_spec.rb

  • Michael Burns - Use unzip_windows_zipfile for unit test

  • Oleksiy Kovyrin - Enable sensitive flag for filebeat file resource

1.4.0

  • Virender Khatri - Updated filebeat version v6.0.1

1.3.0

  • Virender Khatri - Use cookbook elastic_beats_repo

  • Virender Khatri - Updated filebeat version v5.6.4

1.2.0

  • Antek S. Baranski - Adding filebeat on Mac OS X install support

  • Virender Khatri - Update filebeat version v5.6.3

  • Virender Khatri - Added RC preview version support

1.1.0

  • Diogo Costa - PR Fix incorrect access to multiline_pattern attribute #116

  • Virender Khatri - Update file beat version v5.6.0 #117

  • Virender Khatri - Add test recipe missing prospector resource attributes #118

  • Virender Khatri - Match prospector resource attributes type with documentation #119

  • Virender Khatri - Add test recipe for v6 #120

  • Virender Khatri - Updated .kitchen.yml, dokken sync

1.0.0

  • Virender Khatri - LWRP filebeat_prospector now creates configuration file with a prefix lwrp-prospector-#{resource name}, #73

  • Virender Khatri - Prospectors via node attribute node['filebeat']['prospectors'] now uses LWRP filebeat_prospector instead of creating JSON file with a prefix node-prospector-#{prospector name}, #114

  • Virender Khatri - Added prospectors configuration files purge capability, #73, #103

    • Added new attribute default['filebeat']['delete_prospectors_dir'] (default: false). If set to true, cookbook always delete and re-create prospectors configuration directory
    • Added new attribute default['filebeat']['purge_prospectors_dir'] (default: false): If set to true, purge files under prospectors configuration directory, except lwrp-prospector- (created by LWRP)

Note: Set attribute default['filebeat']['delete_prospectors_dir'] or default['filebeat']['purge_prospectors_dir'] as per your requirement.

  • Virender Khatri - Dropped support for Chef <12.x, #110

  • Virender Khatri - No longer activelt test/support Filebeat v1.x, #113

  • Virender Khatri - Updated Kitchen Tests

    • Created Chef 12.x and 13.x tests, #108
    • Use Pinned Travis chef-dk version
    • Use stable chef-dk version
    • Added Amazon, Debian and, Fedora tests
    • Added Filebeat preview release support
    • Added Filebeat test cookbook
  • Virender Khatri - Added recent Filebeat prospector option to LWRP filebeat_prospector, #100

  • Virender Khatri - Updated Filebeat version to v5.5.2

  • Virender Khatri - Added Filebeat Preview (alpha/beta) version support, #112

  • Virender Khatri - Created separate cookbooks for prospectors and service

  • Virender Khatri - Updated attributes to use new . convention, issue #

  • Virender Khatri - Added apt install option --force-yes, #104

0.5.0

  • Virender Khatri - Updated Beats Version to v5.4.2

  • Virender Khatri - Updated config file permissions to 0600

  • Virender Khatri - Optional apt/yum repository setup #98

  • Dmitry Krasnoukhov - Allow to customize filebeat service name

0.4.9

  • Virender Khatri - Updated Beats Version to v5.2.2

0.4.8

  • Kyle Gochenour - PR #89, correct spool_size to use the correct parameter

  • Virender Khatri - Issue #91, allow to ignore package verson in favor of pre installed filebeat packages

  • Virender Khatri - PR #94, Travis CI Fix

  • Len Smith - PR #93, Added check to avoid restart if service is disabled or notify restart is set to false

0.4.7

  • Tom Michaud - PR #86, Supports prospector 'tags' attribute

  • Virender Khatri - Fixed Issue #88, Filebeat 5.2.0 Released, Unable to Install on Ubuntu

  • Virender Khatri - Updated default version to v5.2.0

0.4.6

  • William Soula - PR #83, upgrade to filebeat 5.1.2, fix for #84

0.4.5

  • Virender Khatri - issue #78, fixed windows filebeat directory issue for v5.x

  • Virender Khatri - use chefdk

  • Virender Khatri - added kitchen dokken

0.4.4

  • Virender Khatri - fixed runit service

0.4.3

  • Michael Mosher - added json attributes to filebeat_prospector

  • Virender Khatri - added v5.x support

  • Virender Khatri - updated default filebeat version to v5.1.1

0.4.2

  • Andrei Scopenco - include yum-plugin-versionlock recipe for platform_family instead

0.4.1

  • Jesse Cotton - Add support for using runit instead of the default init system

0.4.0

  • Virender Khatri - fix for #60, HWRP does not restart filebeat service

0.3.9

  • Virender Khatri - fix for #65, added yum apt version lock

  • Virender Khatri - updated beats version to v1.3.1

0.3.8

  • Virender Khatri - #68, config_dir attribute not getting set

0.3.7

  • Virender Khatri - Move derived attributes to recipe attributes

  • Virender Khatri - Update filebeat version to v1.3.0

0.3.6

  • Arif Khan - Added Solaris Support

  • Tom Noonan - Handle when new_resource.action is an array

  • Virender Khatri - Updated filebeat config deprecated url reference

  • Virender Khatri - Added service resource configurable attributes with default values

  • Scott Nelson Windels - Add enable attribute back (used to be enabled, not it has been brought back as enable)

  • Eric Herot - Only call powershell resource on windows machines

  • Virender Khatri - Fix Travis

  • Virender Khatri - Use powershell_script instead

  • Scott Nelson Windels - Remove enabled attribute for now, as it isn't a feature in filebeat beyond the rc versions

0.3.4

  • Samuel Sampaio - added new filebeat prospector attributes

0.3.3

  • Virender Khatri - updated beats version to v1.2.3

0.3.2

  • Prerak Shah - Fixed Travis Errors

  • Prerak Shah - Fixed Unit Tests

  • Al Lefebvre - Added missing attribute for exclude_files

  • Luke Lowery - Fixing issue with patterns and older versions of Ruby
    Updated YAML engine to adhere to ruby style guide

  • Prerak Shah - Fixed default Install paths for windows

  • Martin Smith - Respect service flags on package installation

  • Azat Khadiev - Support spaces in file path for Windows

0.3.1

  • Virender Khatri - fix for #41

  • Virender Khatri - added apt-get options, fix for #39

  • Virender Khatri - bump filebeat version to v1.2.1

0.2.8

  • Spencer Owen - Adds a tag to berksfile

  • Chris Barber - cleaning up mixmatch of tabs and spaces. fixed spelling error on prospector

  • Eric Herot - Fix the formatting on the LWRP example in the README

  • Roberto Rivera - Add include_lines and exclude lines.

  • Sean Nolen - #33 added multiline support for LWRP

  • Sean Nolen - #30 fixed rubocop error

  • Seva Orlov - #34, restart filebeat on upgrade

  • Virender Khatri - update to beat v1.1.2

0.2.7

  • Virender Khatri - #21, add yum_repository resource attribute metadata_expire

  • Virender Khatri - #20, update to beat v1.0.1

0.2.6

  • Virender Khatri - #18, added LWRP resource for prospectors

  • Virender Khatri - #15, fix kitchen test

0.2.5

  • Virender Khatri - disabled default output configuration and enable_localhost_output attributes

  • Virender Khatri - #10, handle missing attribute node['filebeat']['windows']['version_string']

  • Virender Khatri - #6, added specs

  • Virender Khatri - #13, major changes to support repository package install

0.2.1

  • Virender Khatri - Added platforms metadata info

  • Virender Khatri - #8, add missing dependency on powershell for windows platform

  • Virender Khatri - #9, use resource powershell instead of powershell_script

0.2.0

  • Brandon Wilson - Include dpkg options to keep old config files when upgrading filebeat to a new release. Without specifying the dpkg options, dpkg will attempt to interactively ask if it should keep the old conf file, or replace it with the vendor supplied conf file which comes with the new version of the package. Since chef is running dpkg non-interactively, it causes dpkg to exit with code 1, and the chef run fails.

  • Virender Khatri - Fix for #4, handle derived attribute for package_url

  • Patrick Christopher - Added support for Windows OS

0.1.0

  • Virender Khatri - Initial release of filebeat

Check the Markdown Syntax Guide for help with Markdown.

The Github Flavored Markdown page describes the differences between markdown on github and standard markdown.

Collaborator Number Metric
            

2.2.0 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

2.2.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

2.2.0 passed this metric

No Binaries Metric
            

2.2.0 passed this metric

Testing File Metric
            

2.2.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

2.2.0 passed this metric