Commit 122287a2 authored by testserver's avatar testserver

update config

parent 5aad62d9
...@@ -11,9 +11,7 @@ services: ...@@ -11,9 +11,7 @@ services:
source: ./elasticsearch/config/elasticsearch.yml source: ./elasticsearch/config/elasticsearch.yml
target: /usr/share/elasticsearch/config/elasticsearch.yml target: /usr/share/elasticsearch/config/elasticsearch.yml
read_only: true read_only: true
- type: volume - "./elasticsearch/data:/usr/share/elasticsearch/data"
source: elasticsearch
target: /usr/share/elasticsearch/data
ports: ports:
- "$ES_PORT1:9200" - "$ES_PORT1:9200"
- "$ES_PORT2:9300" - "$ES_PORT2:9300"
...@@ -76,5 +74,6 @@ networks: ...@@ -76,5 +74,6 @@ networks:
elk: elk:
driver: bridge driver: bridge
volumes: #volumes:
elasticsearch: # elasticsearch:
# driver: local
...@@ -10,14 +10,14 @@ function setDefaultIndex() { ...@@ -10,14 +10,14 @@ function setDefaultIndex() {
curl --location --request POST "http://$kibana_host/api/kibana/settings" \ curl --location --request POST "http://$kibana_host/api/kibana/settings" \
--header 'kbn-version: 7.12.0' \ --header 'kbn-version: 7.12.0' \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data-raw "{\"changes\":{\"defaultIndex\":\"$1\"}}" --data "{\"changes\":{\"defaultIndex\":\"$1\"}}"
} }
function addILMPolicy() { function addILMPolicy() {
resp=$( resp=$(
curl -s -XPUT "http://$es_host/_ilm/policy/service-log" \ curl -s -XPUT "http://$es_host/_ilm/policy/service-log" \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data-raw '{"policy":{"phases":{"hot":{"min_age":"0ms","actions":{"set_priority":{"priority":100}}},"delete":{"min_age":"365d","actions":{"delete":{"delete_searchable_snapshot":true}}}}}}' --data '{"policy":{"phases":{"hot":{"min_age":"0ms","actions":{"set_priority":{"priority":100}}},"delete":{"min_age":"90d","actions":{"delete":{"delete_searchable_snapshot":true}}}}}}'
) )
echo "$resp" echo "$resp"
if contain "$resp" '{"acknowledged":true}'; then if contain "$resp" '{"acknowledged":true}'; then
...@@ -31,7 +31,7 @@ function addIndexTemplate() { ...@@ -31,7 +31,7 @@ function addIndexTemplate() {
resp=$( resp=$(
curl -s -XPUT "http://$es_host/_index_template/service-log" \ curl -s -XPUT "http://$es_host/_index_template/service-log" \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data-raw '{"template":{"settings":{"index":{"lifecycle":{"name":"service-log"}}},"mappings":{"_source":{"excludes":[],"includes":[],"enabled":true},"_routing":{"required":false},"dynamic":true,"numeric_detection":false,"date_detection":true,"dynamic_date_formats":["strict_date_optional_time","yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"],"dynamic_templates":[]}},"index_patterns":["*-service-*"]}' --data '{"priority":0,"template":{"settings":{"index":{"lifecycle":{"name":"service-log"},"number_of_shards":"1","number_of_replicas":"0"}},"mappings":{"_routing":{"required":false},"numeric_detection":false,"dynamic_date_formats":["strict_date_optional_time","yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"],"_source":{"excludes":[],"includes":[],"enabled":true},"dynamic":true,"dynamic_templates":[],"date_detection":true}},"index_patterns":["*-service-*","*backend*","*chian*","*exdb*","*external*","*other*","*supervisor*","*tanxin*"],"composed_of":[]}'
) )
echo "$resp" echo "$resp"
if contain "$resp" '{"acknowledged":true}'; then if contain "$resp" '{"acknowledged":true}'; then
......
This diff is collapsed.
...@@ -11,22 +11,25 @@ input { ...@@ -11,22 +11,25 @@ input {
## Add your filters / logstash plugins configuration here ## Add your filters / logstash plugins configuration here
filter { filter {
if "lvl=dbug msg=dealBlock module=util cur=" in [message]{
drop {}
}
if "stat.log" in [log][file][path] { if "stat.log" in [log][file][path] {
drop {} drop {}
} }
if "error" in[log][file][path] { if "error" in [log][file][path] {
}else if "sync" in [log][file][path]{
}else if "chain" in [log][file][path] { }else if "chain" in [log][file][path] {
drop {} drop {}
}else if "Chain" in [log][file][path] { }else if "Chain" in [log][file][path] {
drop {} drop {}
}else if "convert" in [log][file][path]{ }else if "convert" in [log][file][path]{
if "person" in [env]{ ## if "person" in [env]{
drop{} ##
}else if "demo" in [env] { ## }else if "demo" in [env] {
drop{} ## drop{}
} ## }
} }
if "backend-env-v1" in [log][file][path] { if "backend-env-v1" in [log][file][path] {
drop {} drop {}
......
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