We collect the logs of the container of our java application on ecs with the container of Filebeat.
When any one or multiple container in the AWS ECS intance restart continously, filebeat container stops pushing logs to elasticsearch.
And if we restart the filebeat container then the logs starts coming.
When I checked the Filebeat log, there were no errors.
filebeat config file (filebeat.yml)
setup.ilm.enabled: false
filebeat.autodiscover:
providers:
- type: docker
hints.enabled: true
json.message_key: log
templates:
- condition:
equals:
docker.container.labels.filebeat_enable: "true"
config:
- type: docker
containers.ids:
- "${data.docker.container.id}"
json.keys_under_root: true
json.add_error_key: false
multiline.pattern: '^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*'
multiline.negate: true
multiline.match: after
multiline.timeout: 120s
multiline.max_lines: 1000
processors:
- add_cloud_metadata: ~
- add_docker_metadata: ~
output.elasticsearch:
hosts: ["http://x.x.x.x:9200","http://x.x.x.x:9200","http://x.x.x.x:9200"]
username: "XXX"
password: "XXXX"