Hi Kibana Masters,
I recently spun up a Docker container ELK pipeline that ends with Elasticsearch 7.4.0 and Kibana 7.4.0 containers. Everything works great… except there is a lag of about five minutes between when data arrives in ES and then when it is visible in Kibana.
Some observations: Both the ES and Kibana containers are running on the same host, and were spun up at the same time. When I do a synchronized “uptime” on each of them, they practically report the same time:
# Elasticsearch Container
[root@f6fafeb52f1b elasticsearch]# uptime
21:19:40 up 41 days, 7:46, 0 users, load average: 2.35, 2.54, 2.69
[root@f6fafeb52f1b elasticsearch]#
# Kibana Container
bash-4.2$ uptime
21:19:40 up 41 days, 7:46, 0 users, load average: 2.35, 2.54, 2.69
bash-4.2$
So both containers agree on the current time. That’s good.
When I inject test traffic, I use ES’s elasticsearch-sql-cli-7.4.0.jar
JAR file to run SQL-like queries. Test data can be seen in these SQL queries perhaps a second or two after I start the test; so I know ES is getting my data in a quick and timely fashion. That’s great.
But here’s the problem: To see the same exact data in Kibana, I have to wait about five minutes before the data appears. (I’ve set the Kibana timeframe to be “Last 5 minutes” and a refresh rate of 1 second.) All the data is there and matches perfectly with what I see in ES… it just takes Kibana much longer to display it.
When I’m in Kibana, and I use the inspect feature to look at the request Kibana sent for a brand-new data record, the timestamp is:
"range": {
"@timestamp": {
"format": "strict_date_optional_time",
"gte": "2019-11-12T21:27:29.397Z",
"lte": "2019-11-12T21:30:29.397Z"
}
}
But an “uptime” done on the Kibana container’s command line at the exact same moment shows:
bash-4.2$ uptime
21:34:05 up 41 days, 8:00, 0 users, load average: 2.60, 2.44, 2.54
bash-4.2$
So it seems Kibana the container thinks that “now” is 21:34 while Kibana the application thinks “now” is 21:27, which would explain my approximate five minute lag between Kibana and ES. In other words, I suspect Kibana the application is five minutes slow, hence all my data appears in a five minute lag.
So, if this is the case, how can I compensate? Thank you.