liveBook · Manning

Elasticsearch

As explained in Learn Docker in a Month of Lunches, Second Edition

Elasticsearch is a distributed search and analytics engine for storing, searching, and analyzing structured and unstructured data.

Elasticsearch provides centralized storage and search for container logs. Fluentd collects and processes Docker output, then forwards records to Elasticsearch, where metadata such as container names supports filtering and identification. section 19.3

A practical Elasticsearch logging workflow connects:

  • Docker containers to Fluentd through Docker’s Fluentd logging driver. section 19.3
  • Fluentd to Elasticsearch for document storage, using indexes as searchable document collections. section 19.3
  • Elasticsearch to Kibana, which provides a search interface for exploring collected logs. section 19.3

Run an EFK logging stack

Start the Docker Compose logging stack, run a container with the Fluentd driver, then open Kibana at http://localhost:5601/app/discover. Create a data view named logs with the fluentd* index pattern and @timestamp as its timestamp field. section 19.3

cd ch19/exercises/fluentd
# run Fluentd publishing the standard port and using a config file:
docker run -d -p 24224:24224 `
 --name fluentd -v "$(pwd)/conf:/fluentd/etc" `
 -e FLUENTD_CONF=stdout.conf `
 diamol/fluentd:2e
# now run a timecheck container set to use Docker's Fluentd log driver:
docker run -d --log-driver=fluentd `
 --name timecheck5 `
 diamol/ch19-timecheck:2e-v3
# check the timecheck container logs:
docker logs timecheck5
# and check the Fluentd container logs:
docker logs --tail 1 fluentd

Run Fluentd, attach a timecheck container to its logging driver, and inspect the resulting container and collector output. section 19.3

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Walks through containerized setup, index selection, and Kibana data views without explaining Elasticsearch internals.
Examples
Uses timecheck and image-gallery containers, Fluentd tags, Docker commands, daily indexes, and Kibana Discover.
What it assumes
Assumes Docker container workflows and introduces index and data-view configuration during the logging exercise.
What you can do after
Operate/configure a containerized Elasticsearch logging stack and search collected records through Kibana.
How it connects
Connects Elasticsearch with Fluentd, Kibana, Docker logging drivers, Docker Compose, and indexes.

Also explained in

Compare how 5 books explain Elasticsearch →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.