O'Reilly logo

The DevOps 2.0 Toolkit by Viktor Farcic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sending Log Entries to ElasticSearch

We'll start by provisioning the logging server with the ELK stack (ElasticSearch, LogStash, and Kibana). We'll continue using Ansible for provisioning since it converted itself into our favorite configuration management tool.

Let's run the elk.yml playbook and explore it while it's executing:

ansible-playbook /vagrant/ansible/elk.yml \
    -i /vagrant/ansible/hosts/prod \
    --extra-vars "logstash_config=file.conf"

The definition of the playbook is as follows:

- hosts: logging
  remote_user: vagrant
  serial: 1
  roles:
    - common
    - docker
    - elasticsearch
    - logstash
    - kibana

We used the common and the docker roles many times before, so we'll skip them, and jump straight into elasticsearch tasks defined in the roles/elasticsearch/tasks ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required