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


graylog (23) Versions 2.0.0

Installs/Configures graylog

cookbook 'graylog', '~> 2.0.0', :supermarket
cookbook 'graylog', '~> 2.0.0'
knife supermarket install graylog
knife supermarket download graylog
Quality 17%

Graylog cookbook

This cookbook sets up Graylog.

Including the following support services:

  • Elasticsearch
  • MongoDB


To quickly setup a working Graylog installation on a single node, do the following:

  1. Setup application secrets

This is required, as it would leave your Graylog installation insecure. Therefore the cookbook
will fail with an error message if you do not set them!

  # Set this to a random string, generated e.g. with "pwgen 96"
  node['graylog']['server']['server.conf']['password_secret'] = 'CHANGE ME!'

  # Generate with "echo -n yourpassword | shasum -a 256"
  node['graylog']['server']['server.conf']['root_password_sha2'] = '...'
  1. Add default recipe to your run_list
    "run_list": [

Supported Platforms

Currently tested on Ubuntu-14.04 LTS.



Please do not expose the Graylog service directly in production. Instead, you
should use a reverse proxy (e.g. nginx).
This also adds the capability to use SSL to secure your logins.

Here's an example nginx site configuration you can use:j
Note: The configuration assumes you set the rest_listen_url accordingly:

default['graylog']['server']['server.conf']['web_endpoint_uri'] = ''
# Upstream to Graylog frontend
proxy_next_upstream error timeout;
upstream graylog_web_interface {
    server fail_timeout=0;

upstream graylog_rest_api {
    server fail_timeout=0;

# Redirect everything to https
server {
    listen 80;

    return 301$request_uri;

server {
    listen 443 ssl;

    # SSL certificate
    ssl_certificate /etc/nginx/certs/;
    ssl_certificate_key /etc/nginx/certs/;

    root /usr/share/nginx/html;

    proxy_pass_header Date;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host:$server_port;
    proxy_redirect off;
    proxy_set_header X_FORWARDED_PROTO $scheme;

    chunked_transfer_encoding off;

    location / {
        proxy_pass http://graylog_web_interface;

    location /api {
        rewrite ^/api(.*)$ $1 break;
        proxy_pass http://graylog_rest_api;


Global attribute:

# Graylog version to use (must be available via the official repositories)
node['graylog']['version'] = '1.3'

Graylog server

Attributes to configure Graylog.
The password_secret and root_password_sha2 attributes NEED to be changed!

# You MUST set a secret to secure/pepper the stored user passwords here. Use at least 64 characters.
# Generate one by using for example: pwgen -s 96
node['graylog']['server']['server.conf']['password_secret'] = 'CHANGE ME!'

# the default root user is named 'admin'
# You MUST specify a hash password for the root user (which you only need to initially set up the
# system and in case you lose connectivity to your authentication backend)
# This password cannot be changed using the API or via the web interface.
# Create one by using for example: "echo -n yourpassword | shasum -a 256"
# For testing purposes (only!) you can use the password "insecure" with the following hash
node['graylog']['server']['server.conf']['root_password_sha2'] = '1d92dae504a70fbcae6d3721a55d7eacaf94d3133ea5f0394b7d203d64841110'

This recipe disables multicast to learn about Elasticsearch. This is recommended for production.

# The default unicast host used and configured by this recipe is automatically retrieved from the Elasticsearch attributes
# (See below, node['graylog']['elasticsearch']['host'] and node['graylog']['elasticsearch']['port'])
node['graylog']['server']['server.conf']['elasticsearch_discovery_zen_ping_multicast_enabled'] = false
node['graylog']['server']['server.conf']['elasticsearch_discovery_zen_ping_unicast_hosts'] = ''

The cookbook accepts every possible configuration option supported by server.conf

node['graylog']['server']['server.conf']['key'] = 'value'


The elasticsearch recipe installs Elasticsearch using the official PPA repository.
You can finetune the installation here, although the defaults should "just work".

The settings below are the defaults

# Elasticsearch version to use. Currently 0.90.x and 1.0.x versions are available
# See:
node['graylog']['elasticsearch']['version'] = '0.90'

# Assign half of the systems memory to elasticsearch heap (recommended setting)
# See:
node['graylog']['elasticsearch']['heap_size'] = "#{(node['memory']['total'].to_i / 1024 / 2).to_i}m"
node['graylog']['elasticsearch']['cluster_name'] = 'graylog2'

# Elasticsearch ip:port to use
node['graylog']['elasticsearch']['host'] = ''
node['graylog']['elasticsearch']['port'] = 9300


The default recipe installs MongoDB, using the MongoDB cookbook.

As MongoDB is only used to store small amounts of data, it's usually sufficient to use a small data partition. Therefore, smallfile is enabled by default.
You can override the setting if needed, like so

node['mongodb']['config']['smallfiles'] = false



Installs and configures Elasticsearch, MongoDB, Graylog server and The Graylog web-interface.


Installs Elasticsearch from the official PPA, and configures it for Graylog use.


Installs and configures Graylog server.


  1. Fork the repository on Github
  2. Create a named feature branch (i.e. add-new-recipe)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request

License and Authors

Author:: Chris Aumann (

Dependent cookbooks

apt >= 0.0.0
mongodb >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Changelog for Graylog cookbook


  • Upgrade default Elasticsearch version to 2.3
  • Upgrade default Graylog version to 2.0
  • Fix issue that graylog-server was not restarted automatically upon config changes
  • New default name graylog instead of graylog2 was not adapted to make migration easier
  • Upgrade Java version to openjdk-8, install openjdk-r PPA on trusty
  • Adapt nginx example in README


  • Add support for graylog2.gzip-filter and graylog2.client.accept-any-certificate web interface attributes


  • Include apt_repository recipe for easier handling in server and web recipes


  • Change default spooling dir to /var/lib/graylog-server, according to package default
  • Update other default settings to match Graylog defaults


  • Update default Graylog version to 1.3.0


  • Use Elasticsearch 1.7 by default


  • Update default Graylog version to 1.2.0
  • Use official repositories to install graylog-server and graylog-web packages
  • Rename web_interface recipe to web, to follow package naming
  • Rename graylog.conf attributes to server.conf to follow package naming
  • Rename graylog-web-interface.conf attribtues to web.conf to follow package naming
  • Add newly introduced options to attributes


  • Update default Graylog version to 1.1.6


  • Update default Graylog version to 1.1.5


  • Update default Graylog version to 1.1.4


  • Update default Graylog version to 1.1.3


  • Update default Graylog version to 1.1.1
  • Update default elasticsearch version to 1.5


  • Update default Graylog version to 1.0.0
  • Configuration option and config file changes according to version 1.0.0

Attribute names for configruation files changed:
graylog2.conf -> graylog.conf
graylog2-web-interface.conf -> graylog-web-interface.conf

Node ID default URL changed (Migrate the file manually, if needed)
/etc/graylog2-server-node-id -> /etc/graylog/server/node-id


  • Update default Graylog2 version to 0.92.3


  • Update default Graylog2 version to 0.92.0
  • Update Elasticsearch 1.4


  • Update default Graylog2 version to 0.91.3


  • Update default Graylog2 version to 0.91.1


  • Update default Graylog2 version to 0.91.0
  • Update Elasticsearch to 1.3


  • Update default Graylog2 version to 0.20.6
  • Disable default secrets/passwords and display helpful error message if not set


  • Initial release of graylog
  • Use default Graylog2 version 0.20.3

Collaborator Number Metric

2.0.0 failed this metric

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

Contributing File Metric

2.0.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, and your repo must contain a file

Foodcritic Metric

2.0.0 failed this metric

FC064: Ensure issues_url is set in metadata: graylog/metadata.rb:1
FC065: Ensure source_url is set in metadata: graylog/metadata.rb:1
FC066: Ensure chef_version is set in metadata: graylog/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: graylog/metadata.rb:1
FC069: Ensure standardized license defined in metadata: graylog/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric

2.0.0 passed this metric

Testing File Metric

2.0.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, and your repo must contain a file

Version Tag Metric

2.0.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, and your repo must include a tag that matches this cookbook version number