Directory / ELK Stack
ELK Stack

ELK Stack

Elasticsearch Stack.

elastic

Open
README.md

Elasticsearch

Awesome but heavy

Token

You need a token to connect Kibana to Elastic.

1.

First start elastic with: docker compose up -d elastic

2.

docker exec -it elastic-elasticsearch-1 bin/elasticsearch-service-tokens create elastic/kibana kibana-new-token

3.

Now place the token in the kibana.yml file: elasticsearch.serviceAccountToken:xxxxxxxx Also generate a32 char string:

xpack.security.encryptionKey: "32_CHAR_HASH"
xpack.encryptedSavedObjects.encryptionKey: "32_CHAR_HASH"
xpack.reporting.encryptionKey: "32_CHAR_HASH"

4.

Run kibana with: docker compose up -d kibana

docker-compose.yml
services:
  elasticsearch:
    image: elastic/elasticsearch:9.3.1
    ports:
      - 9200:9200
    environment:
      discovery.type: 'single-node'
      xpack.security.enabled: 'true'
      ELASTIC_PASSWORD: 'password'
      ES_JAVA_OPTS: '-Xmx8g -Xms8g'
    volumes:
        # Gotta save the data
      - esdata:/usr/share/elasticsearch/data

  kibana:
    image: kibana:9.3.1
    volumes:
      - ./kibana.yml:/usr/share/kibana/config/kibana.yml
    ports:
      - 5601:5601

volumes:
  esdata: