cookbook 'chef_handler_elasticsearch', '~> 1.0.3'
chef_handler_elasticsearch (4) Versions 1.0.3 Follow1
Add elasticsearch report handler to chef-client
cookbook 'chef_handler_elasticsearch', '~> 1.0.3', :supermarket
knife supermarket install chef_handler_elasticsearch
knife supermarket download chef_handler_elasticsearch
chef_handler_elasticsearch Cookbook
This cookbook add handler for post reports to elasticsearch like logstash style.
Reports are shown by kibana easily.
Libraries
default.rb
Chef::Handler::Elasticsearch
Put Chef-Client reports to elasticsearch.
Attributes
default.rb
- node[:chef_handler_elasticsearch][:url]
- Elasticsearch endpoint.
- default:
'http://localhost:9200'
- node[:chef_handler_elasticsearch][:timeout]
- Request for Elasticsearch timeout.
- default:
3
(second)
- node[:chef_handler_elasticsearch][:prefix]
- Prefix for index name. e.g:
chef_handler-2014.05.21
- default:
'chef_handler'
- Prefix for index name. e.g:
- node[:chef_handler_elasticsearch][:index_date_format]
- Date section format of index name. e.g:
chef_handler-2014.05.21
- default:
"%Y.%m.%d"
- Date section format of index name. e.g:
- node[:chef_handler_elasticsearch][:index_use_utc]
- Use utc to index name.
- default:
true
- node[:chef_handler_elasticsearch][:delete_keys]
- Delete some keys from report data before sending to Elasticsearch. Useful for deleting all_resources, updated_resources, node details, etc.
- default: [] (Don't delete)
elasticsearch template settings.
- node[:chef_handler_elasticsearch][:prepare_template]
- Create or update index template before put data.
- default:
true
- node[:chef_handler_elasticsearch][:template_order] = 10
- Index template order.
- default:
true
- node[:chef_handler_elasticsearch][:mappings] = '{
- Index template mapping.
- default:
"_default_" : { "numeric_detection" : true, "dynamic_date_formats" : ["yyyy-MM-dd HH:mm:ss Z", "date_optional_time"] } }'
Recipes
default.rb
Add Chef::Handler::Elasticsearch
to chef config.
Usage
Add to Chef::Config
e.g. your recipes, libraries.
Chef::Config[:report_handlers] << Chef::Handler::Elasticsearch.new
Chef::Config[:exception_handlers] << Chef::Handler::Elasticsearch.new
You can pass settings as argument at initialize.
Chef::Config[:report_handlers] << Chef::Handler::Elasticsearch.new(
url: 'http://test.example.com:9200',
timeout: 10,
)
Add run_list
add recipe[chef_handler_elasticsearch::default]
your run_list.
You can override default settings with chef layers. Such as role, environment, or node.json.
{
"chef_handler_elasticsearch" : {
"url" : "http://test.example.com:9200",
"timeout" : 10
}
}
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write you change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License and Authors
License: apache2
Author: SAWANOBORI Yukihiko(Higanworks LLC)
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
chef_handler_elasticsearch CHANGELOG
This file is used to list changes made in each version of the chef_handler_elasticsearch cookbook.
1.0.3
- Add require for chef/handler #4 HT: @swimfrog
1.0.2
- Add "delete_keys" support
1.0.1
- Use SecureRandom for Pre-11.10
1.0.0
- [sawanoboly] - Initial release of chef_handler_elasticsearch
Collaborator Number Metric
1.0.3 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.3 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.0.3 failed this metric
FC064: Ensure issues_url is set in metadata: chef_handler_elasticsearch/metadata.rb:1
FC065: Ensure source_url is set in metadata: chef_handler_elasticsearch/metadata.rb:1
FC066: Ensure chef_version is set in metadata: chef_handler_elasticsearch/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: chef_handler_elasticsearch/metadata.rb:1
FC069: Ensure standardized license defined in metadata: chef_handler_elasticsearch/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.3 passed this metric
Testing File Metric
1.0.3 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.0.3 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
1.0.3 failed this metric
1.0.3 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.0.3 failed this metric
FC064: Ensure issues_url is set in metadata: chef_handler_elasticsearch/metadata.rb:1
FC065: Ensure source_url is set in metadata: chef_handler_elasticsearch/metadata.rb:1
FC066: Ensure chef_version is set in metadata: chef_handler_elasticsearch/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: chef_handler_elasticsearch/metadata.rb:1
FC069: Ensure standardized license defined in metadata: chef_handler_elasticsearch/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.3 passed this metric
Testing File Metric
1.0.3 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.0.3 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
1.0.3 failed this metric
FC065: Ensure source_url is set in metadata: chef_handler_elasticsearch/metadata.rb:1
FC066: Ensure chef_version is set in metadata: chef_handler_elasticsearch/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: chef_handler_elasticsearch/metadata.rb:1
FC069: Ensure standardized license defined in metadata: chef_handler_elasticsearch/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
1.0.3 passed this metric
Testing File Metric
1.0.3 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.0.3 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
1.0.3 failed this metric
1.0.3 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