fix index name remove date in pattern, drop filebeat event, add default to ignore_older
This commit is contained in:
parent
eb2c942861
commit
133e2fd382
@ -7,6 +7,11 @@ filebeat.autodiscover:
|
|||||||
providers:
|
providers:
|
||||||
- type: docker
|
- type: docker
|
||||||
hints.enabled: true
|
hints.enabled: true
|
||||||
|
hints.default_config:
|
||||||
|
type: container
|
||||||
|
paths:
|
||||||
|
- /var/lib/docker/containers/${data.container.id}/*.log
|
||||||
|
ignore_older: 24h
|
||||||
|
|
||||||
processors:
|
processors:
|
||||||
- add_cloud_metadata: ~
|
- add_cloud_metadata: ~
|
||||||
@ -16,7 +21,14 @@ processors:
|
|||||||
host: "unix:///var/run/docker.sock"
|
host: "unix:///var/run/docker.sock"
|
||||||
- add_host_metadata: ~
|
- add_host_metadata: ~
|
||||||
- dissect:
|
- dissect:
|
||||||
tokenizer: '%{nginx.remote_addr} - %{nginx.remote_user} [%{nginx.time}] %{nginx.host} "%{nginx.request}" %{nginx.status|integer} %{nginx.http_referer} "%{nginx.http_user_agent}" %{nginx.http_x_forwarded_for} %{nginx.request_id} "%{nginx.geoip_country_name}" %{nginx.geoip_country_code} %{nginx.geoip_latitude} %{nginx.geoip_longitude}'
|
tokenizer: '%{nginx.remote_addr} - %{nginx.remote_user} [%{nginx.time}] %{nginx.host} "%{nginx.request}" %{nginx.status|integer} %{nginx.http_referer} "%{nginx.http_user_agent}" %{nginx.http_x_forwarded_for} %{nginx.request_id} "%{nginx.geoip_country_name}" %{nginx.geoip_country_code} %{nginx.geoip.lat|double} %{nginx.geoip.lon|double}'
|
||||||
|
target_prefix: ""
|
||||||
|
field: "message"
|
||||||
|
when:
|
||||||
|
equals:
|
||||||
|
container.name: nginxfront
|
||||||
|
- dissect:
|
||||||
|
tokenizer: '%{php.time} [%{php.status}] %{php.info}: %{php.message}, client: %{php.client}, server: %{php.server}, request: "%{php.request}", upstream: "%{php.upstream}", host: "%{php.host}"'
|
||||||
target_prefix: ""
|
target_prefix: ""
|
||||||
field: "message"
|
field: "message"
|
||||||
when:
|
when:
|
||||||
@ -32,6 +44,10 @@ processors:
|
|||||||
when:
|
when:
|
||||||
equals:
|
equals:
|
||||||
container.name: nginxfront
|
container.name: nginxfront
|
||||||
|
- drop_event:
|
||||||
|
when:
|
||||||
|
equals:
|
||||||
|
container.name: filebeat
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
kibana:
|
kibana:
|
||||||
@ -50,10 +66,11 @@ setup:
|
|||||||
type: keyword
|
type: keyword
|
||||||
- name: kubernetes.container.name
|
- name: kubernetes.container.name
|
||||||
type: keyword
|
type: keyword
|
||||||
|
- name: nginx.geoip
|
||||||
|
type: geo_point
|
||||||
|
|
||||||
dashboards:
|
dashboards:
|
||||||
enabled: false
|
enabled: false
|
||||||
#index: "filebeat-%{[agent.version]}-*"
|
|
||||||
|
|
||||||
output.elasticsearch:
|
output.elasticsearch:
|
||||||
hosts: '[${ELASTICSEARCH_HOSTS:elasticsearch:9200}]'
|
hosts: '[${ELASTICSEARCH_HOSTS:elasticsearch:9200}]'
|
||||||
@ -62,7 +79,8 @@ output.elasticsearch:
|
|||||||
ssl:
|
ssl:
|
||||||
verification_mode: none
|
verification_mode: none
|
||||||
indices:
|
indices:
|
||||||
- index: "filebeat-%{[agent.version]}-%{[container.name]:common}-%{+yyyy.MM.dd}"
|
#- index: "filebeat-%{[agent.version]}-%{[container.name]:common}-%{+yyyy.MM.dd}"
|
||||||
|
- index: "filebeat-%{[agent.version]}-%{[container.name]:common}"
|
||||||
|
|
||||||
|
|
||||||
#logging.json: true
|
#logging.json: true
|
||||||
|
@ -22,6 +22,7 @@ filebeat.autodiscover:
|
|||||||
type: container
|
type: container
|
||||||
paths:
|
paths:
|
||||||
- /var/log/containers/*-${data.kubernetes.container.id}.log
|
- /var/log/containers/*-${data.kubernetes.container.id}.log
|
||||||
|
ignore_older: 24h
|
||||||
|
|
||||||
processors:
|
processors:
|
||||||
- add_cloud_metadata: ~
|
- add_cloud_metadata: ~
|
||||||
@ -46,6 +47,10 @@ processors:
|
|||||||
to: "container.name"
|
to: "container.name"
|
||||||
ignore_missing: true
|
ignore_missing: true
|
||||||
fail_on_error: false
|
fail_on_error: false
|
||||||
|
- drop_event:
|
||||||
|
when:
|
||||||
|
equals:
|
||||||
|
container.name: filebeat
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
kibana:
|
kibana:
|
||||||
@ -67,7 +72,6 @@ setup:
|
|||||||
|
|
||||||
dashboards:
|
dashboards:
|
||||||
enabled: false
|
enabled: false
|
||||||
#index: "filebeat-%{[agent.version]}-*"
|
|
||||||
|
|
||||||
output.elasticsearch:
|
output.elasticsearch:
|
||||||
hosts: '[${ELASTICSEARCH_HOSTS:elasticsearch:9200}]'
|
hosts: '[${ELASTICSEARCH_HOSTS:elasticsearch:9200}]'
|
||||||
@ -76,7 +80,8 @@ output.elasticsearch:
|
|||||||
ssl:
|
ssl:
|
||||||
verification_mode: none
|
verification_mode: none
|
||||||
indices:
|
indices:
|
||||||
- index: "filebeat-%{[agent.version]}-%{[container.name]:common}-%{+yyyy.MM.dd}"
|
#- index: "filebeat-%{[agent.version]}-%{[container.name]:common}-%{+yyyy.MM.dd}"
|
||||||
|
- index: "filebeat-%{[agent.version]}-%{[container.name]:common}"
|
||||||
|
|
||||||
|
|
||||||
#logging.json: true
|
#logging.json: true
|
||||||
|
Loading…
Reference in New Issue
Block a user