A report handler for Chef that creates data that is easily consumable by Splunk.
This handler will create 3 files in /var/chef/splunk:
node.data - Information about the nodes attributes, flattened identically to what we do for search run.data - Information about the specific run resource.data - Information about every resource created during the run
You can then create a simple Splunk app to run all sorts of fun reports.
Using the Splunk Report Handler
In your /etc/chef/client.rb, add the following:
require 'rubygems' require 'chef_handler_splunk' splunk_handler = Chef::Handler::Splunk.new report_handlers << splunk_handler exception_handlers << splunk_handler
The handler takes two options:
:path - A path to drop the report files in - defaults to /var/chef/splunk :keep - The number of backup files to keep (in the normal chef backup location), defaults to 10
Contributing to chef_handler_splunk
Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
Fork the project
Start a feature/bugfix branch
Commit and push until you are happy with your contribution
Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright © 2011 Opscode, Inc.
Released under the Apache 2.0 license - See LICENSE for further details.