Commit a9f67726 authored by 段孔乐's avatar 段孔乐

modify config file

parent 37dc3c1d
......@@ -15,10 +15,10 @@ services:
source: elasticsearch
target: /usr/share/elasticsearch/data
ports:
- "9200:9200"
- "9300:9300"
- "19200:9200"
- "19300:9300"
environment:
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
ES_JAVA_OPTS: "-Xmx512m -Xms512m"
ELASTIC_PASSWORD: changeme
# Use single node discovery in order to disable production mode and avoid bootstrap checks.
# see: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
......@@ -41,12 +41,12 @@ services:
target: /usr/share/logstash/pipeline
read_only: true
ports:
- "5044:5044"
- "5000:5000/tcp"
- "5000:5000/udp"
- "9600:9600"
- "15044:5044"
- "15000:5000/tcp"
- "15000:5000/udp"
- "19600:9600"
environment:
LS_JAVA_OPTS: "-Xmx256m -Xms256m"
LS_JAVA_OPTS: "-Xmx512m -Xms512m"
networks:
- elk
depends_on:
......@@ -63,7 +63,7 @@ services:
target: /usr/share/kibana/config/kibana.yml
read_only: true
ports:
- "5601:5601"
- "15601:5601"
networks:
- elk
depends_on:
......
......@@ -5,8 +5,8 @@ services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
ports:
- "9200:9200"
- "9300:9300"
- "15200:9200"
- "15300:9300"
configs:
- source: elastic_config
target: /usr/share/elasticsearch/config/elasticsearch.yml
......@@ -27,9 +27,9 @@ services:
logstash:
image: docker.elastic.co/logstash/logstash:7.12.0
ports:
- "5044:5044"
- "5000:5000"
- "9600:9600"
- "15044:5044"
- "15000:5000"
- "15600:9600"
configs:
- source: logstash_config
target: /usr/share/logstash/config/logstash.yml
......@@ -46,7 +46,7 @@ services:
kibana:
image: docker.elastic.co/kibana/kibana:7.12.0
ports:
- "5601:5601"
- "15601:5601"
configs:
- source: kibana_config
target: /usr/share/kibana/config/kibana.yml
......
......@@ -9,5 +9,5 @@ network.host: 0.0.0.0
## see https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-xpack.html
#
xpack.license.self_generated.type: trial
xpack.security.enabled: true
xpack.security.enabled: false
xpack.monitoring.collection.enabled: true
......@@ -10,11 +10,54 @@ input {
## Add your filters / logstash plugins configuration here
output {
elasticsearch {
hosts => "elasticsearch:9200"
user => "elastic"
password => "changeme"
ecs_compatibility => disabled
filter {
if ("stat.log" in [log][file][path]) {
drop {}
}
mutate {
add_field => { "input-type" => "%{[agent][type]}-%{[input][type]}" }
remove_field => ["agent","ecs","tags","input","host"]
}
json{
source => "message"
skip_on_invalid_json => true
target => "json"
}
if "gateway" in [log][file][path]{
mutate { add_field => { "[@metadata][target_index]" => "gateway-service-%{+YYYY.MM}" } }
}
else if "swagger" in [log][file][path]{
mutate { add_field => { "[@metadata][target_index]" => "swagger-service-%{+YYYY.MM}" } }
}
else if "auth-service" in [log][file][path] {
mutate { add_field => { "[@metadata][target_index]" => "auth-service-%{+YYYY.MM}" } }
}
else if "file-service" in [log][file][path] {
mutate { add_field => { "[@metadata][target_index]" => "file-service-%{+YYYY.MM}" } }
}
else if "notify-service" in [log][file][path] {
mutate { add_field => { "[@metadata][target_index]" => "notify-service-%{+YYYY.MM}" } }
}
else if "pay-service" in [log][file][path] {
mutate { add_field => { "[@metadata][target_index]" => "pay-service-%{+YYYY.MM}" } }
}
else if "proof-service" in [log][file][path] {
mutate { add_field => { "[@metadata][target_index]" => "proof-service-%{+YYYY.MM}" } }
}
else if "tx-service" in [log][file][path] {
mutate { add_field => { "[@metadata][target_index]" => "tx-service-%{+YYYY.MM}" } }
}
else if "user-service" in [log][file][path] {
mutate { add_field => { "[@metadata][target_index]" => "user-service-%{+YYYY.MM}" } }
}else {
mutate { add_field => { "[@metadata][target_index]" => "others-%{+YYYY.MM}" } }
}
}
output {
elasticsearch{
index => "%{[@metadata][target_index]}"
hosts => ["elasticsearch:9200"]
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment