1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:15 +02:00

update elk

This commit is contained in:
kev 2018-01-06 21:38:57 +08:00
parent 3409a35bc5
commit 83d151a51c
9 changed files with 62 additions and 76 deletions

View File

@ -1,6 +0,0 @@
input {
lumberjack {
port => 5000
type => "logs"
}
}

View File

@ -1,6 +0,0 @@
input {
beats {
port => 5044
ssl => false
}
}

View File

@ -1,13 +0,0 @@
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
syslog_pri { }
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
}

View File

@ -1,7 +0,0 @@
filter {
if [type] == "nginx-access" {
grok {
match => { "message" => "%{NGINXACCESS}" }
}
}
}

View File

@ -1,9 +0,0 @@
output {
elasticsearch {
hosts => ["elasticsearch"]
sniffing => true
manage_template => false
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
}

6
elk/data/logstash.yml Normal file
View File

@ -0,0 +1,6 @@
http.host: "0.0.0.0"
path.config: /usr/share/logstash/pipeline
#xpack.monitoring.enabled: false
xpack.monitoring.elasticsearch.url: http://elasticsearch:9200
#xpack.monitoring.elasticsearch.username: logstash_system
#xpack.monitoring.elasticsearch.password: changeme

View File

@ -0,0 +1,14 @@
input {
beats {
port => 5044
}
}
output {
stdout {
codec => rubydebug
}
elasticsearch {
hosts => [ "elasticsearch:9200" ]
}
}

View File

@ -1,33 +1,42 @@
version: '2'
services:
elasticsearch:
image: elasticsearch:5.0
ports:
- '9200:9200'
- '9300:9300'
volumes:
- ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- ./data:/usr/share/elasticsearch/data
mem_limit: 4g
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
logstash:
image: logstash:5.0
ports:
- '5000:5000'
- '5044:5044'
volumes:
- ./conf:/etc/logstash/conf.d
kibana:
image: kibana:5.0
ports:
- '5601:5601'
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.1.1
ports:
- "9200:9200"
volumes:
- ./data:/usr/share/elasticsearch/data
environment:
- node_name=elastic-search
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
ulimits:
memlock:
soft: -1
hard: -1
restart: unless-stopped
logstash:
image: docker.elastic.co/logstash/logstash:6.1.1
ports:
- "5044:5044"
- "9600:9600"
links:
- elasticsearch
volumes:
- ./data/logstash.yml:/usr/share/logstash/config/logstash.yml
- ./data/pipeline:/usr/share/logstash/pipeline
- /usr/share/logstash/vendor/bundle
environment:
LS_JAVA_OPTS: "-Xms1g -Xmx1g"
restart: unless-stopped
kibana:
image: docker.elastic.co/kibana/kibana:6.1.1
ports:
- "5601:5601"
links:
- elasticsearch
environment:
SERVER_NAME: kibana
ELASTICSEARCH_URL: http://elasticsearch:9200
restart: unless-stopped

View File

@ -1,2 +0,0 @@
network.host: 0.0.0.0
bootstrap.mlockall: true