Last active
June 30, 2019 16:33
-
-
Save xandout/5edd913b7c4f63c3d5b79e121c6461dd to your computer and use it in GitHub Desktop.
Docker, ELK, Syslog, Magic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2.4' | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1 | |
volumes: | |
- es-data:/usr/share/elasticsearch/data | |
environment: | |
- discovery.type=single-node | |
- cluster.name=docker-cluster | |
- "ES_JAVA_OPTS=-Xms2G -Xmx2G" | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 | |
nofile: | |
soft: 65536 | |
hard: 65536 | |
kibana: | |
image: docker.elastic.co/kibana/kibana:7.1.1 | |
ports: | |
- 5601:5601 | |
logstash: | |
image: docker.elastic.co/logstash/logstash:7.1.1 | |
ports: | |
- 514:5140 | |
volumes: | |
- ./logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro | |
env_file: | |
- ./.env | |
volumes: | |
es-data: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input syslog { | |
port => 5140 | |
tags => ["your", "tags", "here"] | |
} | |
filter { | |
# https://www.elastic.co/guide/en/logstash/current/filter-plugins.html | |
# I typically use grok to parse my messages, use include/exclude to include/exclude. date filter to parse dates and set the "@timestamp" key to use my log's timestamp not the ingest timestamp | |
} | |
output { | |
elasticsearch { | |
hosts => ["http://elasticsearch:9200"] #"elasticsearch" is the container name defined in compose and the hostname for that container inside the bridged network docker-compose created for you. docker network logstash | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment