Installs/Configures the Logentries agent to allow logging to Logentries
- Debian
- Ubuntu
- Rhel
The following are dependencies of the Logentries cookbook
- apt
- yum
node['le']['account_key']
- your Logentries account_key (this can be found following this link)node['le']['data_bag_name']
- Name of a data bag containing account key.node['le']['data_bag_item_name']
- Name of a data bag item containing account key.node['le']['hostname']
- sets the hostname of the log to the machine name, defaults tonode['hostname']
node['le']['logs_to_follow']
- An array of logs to follow or an array of hashesnode['le']['datahub']['enable']
- To send logs to datahub set this to true. Default is falsenode['le']['datahub']['server_ip']
- IP of your datahub servernode['le']['datahub']['port']
- port datahub is running on, normally port 10000node['le']['pull-server-side-config']
- Specifies whether to make an api call to pull configuration or not, by default this is set to true meaning an api call will be made to logentries.com. Default is truenode['le']['deb']
- the distro of the debian platform , defaults to node['lsb']['codename'].
Notice: If node['le']['account_key']
is empty, then the chef will get account_key from the data bag.
Example of a data bag:
{
"id": "le",
"account_key": "f8dbebcc-f907-41e1-9089-701134572b36"
}
- caveats - name needs to be unique
There are 3 main scenarios in which the Logentries Linux Agent can be run.
override['le']['account_key'] = <logentries_account_key>
override['le']['logs_to_follow'] = ['/var/log/syslog']
override['le']['logs_to_follow'] = [{:name => 'syslog', :log => '/var/log/syslog'}]
This is the normal case where you send the data directly to Logentries and get the configuration for your logs from Logentries as well. To send data to logentries you will have to override node['le']['account_key']
override['le']['pull-server-side-config'] = false
override['le']['logs_to_follow'] = [{:name => 'syslog', :log => '/var/log/syslog', :token => '00000000-0000-0000-0000-000000000000'}]
To send data to Logentries without specifying an account key, you can set override['le']['pull-server-side-config'] to false. This will only send the logs specified in the configuration file without contacting Logentries. In this case you have to create the logs in advance and know the tokens as well.
override['le']['datahub']['enable'] = true
override['le']['pull-server-side-config'] = false
override['le']['datahub']['server_ip'] = '1.2.3.4'
override['le']['datahub']['port'] = 10000
override['le']['logs_to_follow'] = [{:name => 'syslog', :log => '/var/log/syslog'}]
This scenario is for datahub users looking to push a config and not need to register to send their logs to their datahub instance.
Put depends 'yum', and 'apt', in your metadata.rb to gain access to the resources.
Restarting the Chef script will allow the recipe to install any updates to the Logentries agent.
- Author:: Joe Heung ([email protected])
Copyright (C) 2015, RevelOps Inc.
License:: All rights reserved