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 1.3.0

Installs/Configures Elastic Filebeat

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

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', '~> 1.3.0'

From Git

cookbook 'filebeat', github: 'vkhatri/chef-filebeat',  tag: 'v1.3.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

  • 1.x (dropped test support in cookbook version v1.0.0)
  • 5.x
  • 6.x

Major Changes

Refer CHANGELOG.md.

Cookbook Dependency

  • windows
  • elastic_beats_repo
  • yum-plugin-versionlock
  • runit

Recipes

  • filebeat::attributes - cookbook derived default attributes

  • filebeat::config - configure filebeat

  • filebeat::default - default recipe (use it for run_list)

  • filebeat::install_mac_os_x - install filebeat for mac osx platform

  • filebeat::install_package - install filebeat package for linux platform

  • filebeat::install_package_preview - install filebeat preview (alpha/beta) package for linux platform

  • filebeat::install_solaris - install filebeat package for solaris platform

  • filebeat::install_windows - install filebeat for windows platform

  • filebeat::prospectors - configure filebeat prospectors via node attribute node['filebeat']['prospectors']

  • filebeat::service - configure filebeat service

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_prospector

LWRP filebeat_prospector creates filebeat prospector configuration yaml file under directory node['filebeat']['prospectors_dir'] with file name lwrp-prospector-#{resource_name}.yml.

LWRP example

filebeat_prospector 'messages' do
  paths ['/var/log/messages']
  document_type 'apache'
  ignore_older '24h'
  scan_frequency '15s'
  harvester_buffer_size 16384
  fields 'type' => 'apacheLogs'
end

LWRP Options

  • action (optional) - default :create, options: :create, :delete
  • type (optional, String) - filebeat prospector configuration attribute
  • input_type (optional, String) - filebeat prospector configuration attribute
  • paths (optional, String) - filebeat prospector configuration attribute
  • recursive_glob_enabled (optional, TrueClass/FalseClass) - filebeat prospector configuration attribute
  • encoding (optional, String) - filebeat prospector configuration attribute
  • exclude_lines (optional, Array) - A list of regular expressions to match the lines that you want filebeat to exclude. Filebeat drops any lines that match a regular expression in the list. By default, no lines are dropped.
  • include_lines (optional, Array) - A list of regular expressions to match the lines that you want filebeat to include. Filebeat exports only the lines that match a regular expression in the list. By default, all lines are exported.
  • exclude_files (optional, Array) - A list of regular expressions to match the files that you want filebeat prospector instance to exclude.
  • tags (optional, Array) - filebeat prospector configuration attribute
  • fields (optional, Hash) - filebeat prospector configuration attribute
  • fields_under_root (optional, TrueClass/FalseClass) - filebeat prospector configuration attribute
  • ignore_older (optional, String) - filebeat prospector configuration attribute
  • close_inactive (optional, String) - filebeat prospector configuration attribute
  • close_renamed (optional, String) - filebeat prospector configuration attribute
  • close_eof (optional, String) - filebeat prospector configuration attribute
  • close_timeout (optional, String) - filebeat prospector configuration attribute
  • clean_inactive (optional, String) - filebeat prospector configuration attribute
  • clean_removed (optional, String) - filebeat prospector configuration attribute
  • scan_frequency (optional, String) - filebeat prospector configuration attribute
  • scan_sort (optional, String) - filebeat prospector configuration attribute scan.sort
  • scan_order (optional, String) - filebeat prospector configuration attribute sort.order
  • document_type (optional, String) - filebeat prospector configuration attribute
  • harvester_buffer_size (optional, Integer) - filebeat prospector configuration attribute
  • max_bytes (optional, Integer) - filebeat prospector configuration attribute
  • json_keys_under_root (optional, String) - filebeat prospector configuration attribute json.keys_under_root
  • json_overwrite_keys (optional, String) - filebeat prospector configuration attribute json.overwrite_keys
  • json_add_error_key (optional, String) - filebeat prospector configuration attribute json.add_error_key
  • json_message_key (optional, String) - filebeat prospector configuration attribute json.message_key
  • multiline_pattern (optional, String) - filebeat prospector configuration attribute multiline.pattern
  • multiline_negate (optional, String) - filebeat prospector configuration attribute multiline.negate
  • multiline_match (optional, String) - filebeat prospector configuration attribute multiline.match
  • multiline_flush_pattern (optional, String) - filebeat prospector configuration attribute multiline.flush_pattern
  • multiline_max_lines (optional, String) - filebeat prospector configuration attribute multiline.max_lines
  • multiline_timeout (optional, String) - filebeat prospector configuration attribute multiline.timeout
  • tail_files (optional, TrueClass/FalseClass) - filebeat prospector configuration attribute
  • pipeline (optional, String) - filebeat prospector configuration attribute
  • symlinks (optional, String) - filebeat prospector configuration attribute
  • backoff (optional, String) - filebeat prospector configuration attribute
  • max_backoff (optional, String) - filebeat prospector configuration attribute
  • backoff_factor (optional, Integer) - filebeat prospector configuration attribute
  • harvester_limit (optional, Integer) - filebeat prospector configuration attribute
  • enabled (optional, TrueClass/FalseClass) - filebeat prospector configuration attribute
  • close_older (optional, String) - filebeat prospector configuration attribute
  • force_close_files (optional, TrueClass/FalseClass) - filebeat prospector configuration attribute
  • multiline (optional, Hash) - Multiline configuration hash. Options: pattern: <regex pattern to match>, negate: [true/false], match: [before/after]

How to Add Filebeat Output Configuration via Node Attribute

Filebeat output configuration can be added to attribute node['filebeat']['config'].

  "default_attributes": {
    "filebeat": {
      "config": {
        "output.elasticsearch": {
          "enable": true,
          "hosts": "127.0.0.1:9200"
        },
        "output.redis": {
          "enable": true,
          "option ..": "value .."
        },
        "{output.redis|output.elasticsearch|output.kafka|output.file|output.console|output.logstash| ..}": {
          "option ..": "value ..",
        }
      }
    }
  }

Above filebeat output configuration will be added to filebeat.yml file.

How to Add Filebeat Prospectors via Node Attribute

Individual prospector configuration file can also be added using attribute default['filebeat']['prospectors']. Each prospector configuration will be created using LWRP.
For more prospector options, check out LWRP filebeat_prospector

  "default_attributes": {
    "filebeat": {
      "prospectors": {

        "system_logs": {
          "paths": [
            "/var/log/messages",
            "/var/log/syslog"
          ],
          "type": "log",
          "fields": {
            "type": "system_logs"
          },
          "option ...": "value ..."
        },

        "apache_logs": {
          "paths": [
            "/var/log/apache/*.log"
          ],
          "type": "log",
          "ignore_older": "24h",
          "scan_frequency": "15s",
          "harvester_buffer_size": 16384,
          "fields": {
            "type": "apache_logs"
          },
          "option ...": "value ..."
        },

        "prospector ...": {
          "option ...": "value ..."
        }

      }
    }
  }

Above configuration will create three different prospector files - lwrp-prospector-system_logs.yml, lwrp-prospector-secure_logs.yml and lwrp-prospector-apache_logs.yml under node['filebeat']['prospectors_dir'].

Core Attributes

  • default['filebeat']['version'] (default: 5.6.4): filebeat version

  • default['filebeat']['ignore_version'] (default: false): ignore filebeat version for package install

  • default['filebeat']['setup_repo'] (default: true): setup apt or yum repository if set to true

  • default['filebeat']['release'] (default: 1): filebeat release for yum package

  • default['filebeat']['service']['init_style'] (default: init): filebeat service init system, options: init, runit

  • default['filebeat']['package_url'] (default: auto): package url for windows installation

  • default['filebeat']['log_dir'] (default: /var/log/filebeat): filebeat logging directory

  • default['filebeat']['conf_dir'] (default: /etc/filebeat): filebeat yaml configuration file directory

  • default['filebeat']['conf_file'] (default: /etc/filebeat/filebeat.yml): filebeat configuration file

  • default['filebeat']['notify_restart'] (default: true): whether to restart filebeat service on configuration file change

  • default['filebeat']['disable_service'] (default: false): whether to stop and disable filebeat service

  • default['filebeat']['prospectors_dir'] (default: /etc/filebeat/conf.d): prospectors configuration file directory

  • default['filebeat']['prospectors'] (default: {}): prospectors configuration via node attribute

  • default['filebeat']['modules'] (default: {}): modules configuration via node attribute

  • default['filebeat']['delete_prospectors_dir'] (default: false): delete and create prospectors configuration directory if set to true

  • default['filebeat']['purge_prospectors_dir'] (default: false): purge files under prospectors configuration directory if set to true, except node-prospector-* (created by node attribute) and lwrp-prospector- (created by LWRP)

Configuration File filebeat.yml Attributes

  • default['filebeat']['config']['filebeat.prospectors'] (default: []): filebeat prospectors configuration

  • default['filebeat']['config']['filebeat.modules'] (default: []): filebeat prospectors configuration

  • default['filebeat']['config']['filebeat.registry_file'] (default: /var/lib/filebeat/registry): filebeat services to capture packets

  • default['filebeat']['config']['filebeat.config_dir'] (default: node['filebeat']['prospectors_dir']): filebeat prospectors configuration files folder

For more attribute info check attributes/config.rb.

Other Attributes

  • default['filebeat']['service']['name'] (default: filebeat): filebeat service name

  • default['filebeat']['service']['retries'] (default: :0): filebeat service resource attribute

  • default['filebeat']['service']['retry_delay'] (default: :2): filebeat service resource attribute

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_beats_repo >= 0.0.0
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

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
            

1.3.0 failed this metric

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

Contributing File Metric
            

1.3.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
            

1.3.0 failed this metric

FC109: Use platform-specific package resources instead of provider property: filebeat/recipes/install_package_preview.rb:41
Run with Foodcritic Version 12.2.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

1.3.0 passed this metric

No Binaries Metric
            

1.3.0 passed this metric

Testing File Metric
            

1.3.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
            

1.3.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 include a tag that matches this cookbook version number