|
|
|
@ -14,6 +14,8 @@ filter {
|
|
|
|
if [message] =~ /^{.*}$/ {
|
|
|
|
if [message] =~ /^{.*}$/ {
|
|
|
|
json {
|
|
|
|
json {
|
|
|
|
source => "message"
|
|
|
|
source => "message"
|
|
|
|
|
|
|
|
skip_on_invalid_json => true
|
|
|
|
|
|
|
|
remove_field => [ "[event][original]" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if [stack_trace] {
|
|
|
|
if [stack_trace] {
|
|
|
|
ruby {
|
|
|
|
ruby {
|
|
|
|
@ -48,7 +50,7 @@ filter {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mutate {
|
|
|
|
mutate {
|
|
|
|
remove_field => [ "[id]", "[agent]", "[log][file][path]", "[docker][container][labels]", "[host][ip]", "[host][mac]", "[host][name]" ]
|
|
|
|
remove_field => [ "[agent]", "[container][id]", "[docker]", "[ecs]", "[host]", "[log]", "[stream]" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -174,6 +176,18 @@ output {
|
|
|
|
manage_template => false
|
|
|
|
manage_template => false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if [kubernetes][container][name] {
|
|
|
|
|
|
|
|
elasticsearch {
|
|
|
|
|
|
|
|
hosts => ["https://{{ shared_service_elastic_stack_01_hostname }}:{{ service_port_elasticsearch }}"]
|
|
|
|
|
|
|
|
cacert => "/usr/share/logstash/config/certificates/ca/ca.crt"
|
|
|
|
|
|
|
|
user => "{{ elastic_admin_username }}"
|
|
|
|
|
|
|
|
password => "{{ elastic_admin_password }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
index => "%{[stage]}-%{[kubernetes][namespace]}-%{[kubernetes][container][name]}-%{+YYYY.MM}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
manage_template => false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
elasticsearch {
|
|
|
|
elasticsearch {
|
|
|
|
hosts => ["https://{{ shared_service_elastic_stack_01_hostname }}:{{ service_port_elasticsearch }}"]
|
|
|
|
hosts => ["https://{{ shared_service_elastic_stack_01_hostname }}:{{ service_port_elasticsearch }}"]
|
|
|
|
|