Hello,
I have Elastic Stack (ElasticSearch + Kibana + Logstash + Filebeat) up and running in production, and every module is running in docker, with the officials images provided by elastic.
Filebeat instance is connected and ingesting data about docker logs (from another 'dockerized' app that serves a web plataform) to Elasticsearch. I have been monitoring and adjusting configurations for a couple of weeks and everything seems fine so far..
The thing is that the web platform prints several log lines per minute, and the problem is that I don't know why but filebeat (or Elasticsearch) is not indexing all the logs, mostly the old ones.
So I have one index per day, and as you can see, if I leave a few days everything just like this, docs numbers doesn't increase much, or even worse, doesn't increase at all (for example index 25.01.2019 or index 21.01.2019 that is not even indexed):
I don't get to trust if the ingestion is working fine.. I don't have any errors logs in the elastic modules, only some isolated overhead ones in elasticsearch.
[2019-02-06T10:08:41,292][INFO ][o.e.m.j.JvmGcMonitorService] [QyJqSRr] [gc][394787] overhead, spent [403ms] collecting in the last [1s]
[2019-02-06T13:06:30,535][INFO ][o.e.m.j.JvmGcMonitorService] [QyJqSRr] [gc][405443] overhead, spent [430ms] collecting in the last [1s]
[2019-02-06T13:39:32,686][INFO ][o.e.m.j.JvmGcMonitorService] [QyJqSRr] [gc][407422] overhead, spent [328ms] collecting in the last [1s]
(The specs of the server I am running the stack are: 2 GB RAM - 1 CPU - 50 GB Disk)
I have tried thing such as cleaning indices cache, or deleting the indices and let them re-create again.. but nothing worked so far.
I leave here my filebeat.yml
conf, which is the one that I consider relevant for this problem. I was also wondering if there are any best practices with the configs to try to get all the logs (such as the time set in close_inactive
and scan_frequency
)
filebeat.inputs:
- type: docker
close_inactive: 5m
scan_frequency: 10s
combine_partial: true
multiline.pattern: '^.,'
multiline.negate: true
multiline.match: after
containers:
ids:
- '*'
json.overwrite_keys: true
setup.template.enabled: true
setup.template.name: "filebeat"
setup.template.pattern: "filebeat-*"
setup.kibana:
host: <host>
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
- add_docker_metadata: ~
output.logstash:
hosts: <host>
xpack.monitoring:
enabled: true
elasticsearch:
hosts: <host>
Monitoring screen:
Here is a sample of logs timestamps in less that a minute (I deleted log lines for privacy reasons) so you can have an aprox amount of logs per minute:
I, [2019-01-26T20:39:03.328611 #54]
I, [2019-01-26T20:39:04.167190 #51]
I, [2019-01-26T20:39:04.911602 #51]
I, [2019-01-26T20:39:04.917009 #51]
I, [2019-01-26T20:39:04.917127 #51]
D, [2019-01-26T20:39:04.922000 #51]
D, [2019-01-26T20:39:04.926078 #51]
D, [2019-01-26T20:39:04.927655 #51]
D, [2019-01-26T20:39:04.934731 #51]
D, [2019-01-26T20:39:04.938701 #51]
D, [2019-01-26T20:39:04.946900 #51]
D, [2019-01-26T20:39:04.948744 #51]
D, [2019-01-26T20:39:04.952247 #51]
D, [2019-01-26T20:39:04.966808 #51]
D, [2019-01-26T20:39:04.980669 #51]
D, [2019-01-26T20:39:04.988168 #51]
D, [2019-01-26T20:39:04.996505 #51]
I, [2019-01-26T20:39:05.599940 #54]
I, [2019-01-26T20:39:05.723844 #51]
I, [2019-01-26T20:39:13.443756 #51]
I, [2019-01-26T20:39:14.172979 #54]
I, [2019-01-26T20:39:15.605774 #51]
I, [2019-01-26T20:39:23.560680 #54]
I, [2019-01-26T20:39:24.179016 #51]
I, [2019-01-26T20:39:25.612253 #54]
I, [2019-01-26T20:39:28.791610 #51]
I, [2019-01-26T20:39:28.795650 #51]
D, [2019-01-26T20:39:28.800424 #51]
D, [2019-01-26T20:39:28.803388 #51]
D, [2019-01-26T20:39:28.806776 #51]
D, [2019-01-26T20:39:28.810037 #51]
D, [2019-01-26T20:39:28.812938 #51]
D, [2019-01-26T20:39:28.816084 #51]
D, [2019-01-26T20:39:28.819838 #51]
D, [2019-01-26T20:39:28.823770 #51]
D, [2019-01-26T20:39:28.826639 #51]
D, [2019-01-26T20:39:28.830148 #51]
D, [2019-01-26T20:39:28.833498 #51]
D, [2019-01-26T20:39:28.838195 #51]
D, [2019-01-26T20:39:28.840348 #51]
D, [2019-01-26T20:39:28.842862 #51]
I, [2019-01-26T20:39:28.844530 #51]
I, [2019-01-26T20:39:28.845306 #51]
D, [2019-01-26T20:39:28.846696 #51]
D, [2019-01-26T20:39:28.849102 #51]
D, [2019-01-26T20:39:28.852300 #51]
D, [2019-01-26T20:39:28.855567 #51]
D, [2019-01-26T20:39:28.859742 #51]
D, [2019-01-26T20:39:28.861523 #51]
D, [2019-01-26T20:39:28.863520 #51]
D, [2019-01-26T20:39:28.865957 #51]
D, [2019-01-26T20:39:28.867419 #51]
D, [2019-01-26T20:39:28.869776 #51]
D, [2019-01-26T20:39:28.871475 #51]
D, [2019-01-26T20:39:28.873308 #51]
D, [2019-01-26T20:39:28.875566 #51]
D, [2019-01-26T20:39:28.877220 #51]
I, [2019-01-26T20:39:28.879085 #51]
D, [2019-01-26T20:39:28.883421 #51]
D, [2019-01-26T20:39:28.888947 #51]
D, [2019-01-26T20:39:28.892591 #51]
D, [2019-01-26T20:39:28.938300 #51]
D, [2019-01-26T20:39:28.941294 #51]
D, [2019-01-26T20:39:28.943258 #51]
D, [2019-01-26T20:39:28.945629 #51]
D, [2019-01-26T20:39:28.947309 #51]
D, [2019-01-26T20:39:28.949648 #51]
D, [2019-01-26T20:39:28.951606 #51]
D, [2019-01-26T20:39:28.953524 #51]
D, [2019-01-26T20:39:28.956036 #51]
D, [2019-01-26T20:39:28.957950 #51]
D, [2019-01-26T20:39:28.959591 #51]
D, [2019-01-26T20:39:28.961913 #51]
D, [2019-01-26T20:39:28.963721 #51]
D, [2019-01-26T20:39:28.965886 #51]
D, [2019-01-26T20:39:28.967896 #51]
D, [2019-01-26T20:39:28.969675 #51]
D, [2019-01-26T20:39:28.972071 #51]
D, [2019-01-26T20:39:28.973690 #51]
D, [2019-01-26T20:39:28.975851 #51]
D, [2019-01-26T20:39:28.977380 #51]
D, [2019-01-26T20:39:28.979141 #51]
D, [2019-01-26T20:39:28.981362 #51]
D, [2019-01-26T20:39:28.982992 #51]
D, [2019-01-26T20:39:28.984326 #51]
D, [2019-01-26T20:39:28.986509 #51]
D, [2019-01-26T20:39:28.988108 #51]
So please, could you help me to find out what is the problem or miss configuration that it's making me lose the logs?
Thanks