Created
May 14, 2019 21:04
-
-
Save agramajo/026fa3c1b283d10a7dc8f4ff1bd1bb53 to your computer and use it in GitHub Desktop.
docker-elk
This file contains 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' | |
services: | |
elasticsearch: | |
build: | |
context: elasticsearch/ | |
args: | |
ELK_VERSION: $ELK_VERSION | |
volumes: | |
- ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro | |
- ./data:/usr/share/elasticsearch/data | |
ports: | |
- "9200:9200" | |
- "9300:9300" | |
environment: | |
ES_JAVA_OPTS: "-Xmx1g -Xms1g" | |
networks: | |
- elk | |
logstash: | |
build: | |
context: logstash/ | |
args: | |
ELK_VERSION: $ELK_VERSION | |
volumes: | |
- ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro | |
- ./logstash/pipeline:/usr/share/logstash/pipeline:ro | |
ports: | |
- "5140:5140/udp" | |
- "5000:5000" | |
- "9600:9600" | |
environment: | |
LS_JAVA_OPTS: "-Xmx1g -Xms1g" | |
networks: | |
- elk | |
depends_on: | |
- elasticsearch | |
kibana: | |
build: | |
context: kibana/ | |
args: | |
ELK_VERSION: $ELK_VERSION | |
volumes: | |
- ./kibana/config/:/usr/share/kibana/config:ro | |
ports: | |
- "5601:5601" | |
networks: | |
- elk | |
depends_on: | |
- elasticsearch | |
networks: | |
elk: | |
driver: bridge |
This file contains 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 { | |
udp { | |
port => 5140 | |
queue_size => 50000 | |
type => "nginx" | |
} | |
} | |
filter { | |
grok { | |
match => [ "message" , "%{COMBINEDAPACHELOG}+%{GREEDYDATA:extra_fields}"] | |
overwrite => [ "message" ] | |
} | |
mutate { | |
convert => ["response", "integer"] | |
convert => ["bytes", "integer"] | |
convert => ["responsetime", "float"] | |
} | |
geoip { | |
source => "clientip" | |
target => "geoip" | |
add_tag => [ "nginx-geoip" ] | |
} | |
date { | |
match => [ "timestamp" , "dd/MMM/YYYY:HH:mm:ss Z" ] | |
remove_field => [ "timestamp" ] | |
} | |
useragent { | |
source => "agent" | |
} | |
} | |
output { | |
elasticsearch { | |
hosts => "elasticsearch:9200" | |
index => "nginx" | |
} | |
stdout { codec => rubydebug } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment