lifer
(Oleksii Samodid)
November 22, 2021, 11:54am
1
Hi guys!
I've tried the new lens time shift feature, everything works fine with dates indexed as "strict_date_time", but when I try that on index with dates indexed as "epoch_millis" I get the following error:
Is this something yet to be fixed by Kibana developers?
flash1293
(Joe Reuter)
November 22, 2021, 1:03pm
2
Hey, this is not a known problem. Could you share your mapping and maybe an example document to reproduce the issue?
lifer
(Oleksii Samodid)
November 22, 2021, 3:03pm
3
PUT /test
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"refresh_interval" : "1s"
}
},
"mappings" : {
"dynamic" : "strict",
"date_detection" : false,
"properties" : {
"timestamp" : {
"type" : "date",
"format" : "epoch_millis"
}
}
}
}
POST test/_doc/
{
"timestamp": 1636749579080
}
lifer
(Oleksii Samodid)
November 22, 2021, 3:05pm
4
I've just figured out that timestamp on the error message is related to the time range of the visualization, not the timestamp from the document.
flash1293
(Joe Reuter)
November 23, 2021, 10:56am
5
Thank you, this is very helpful. This is indeed a bug in the time shift logic (and also in the field existence logic, but that one is not as severe). I opened issues here:
opened 10:52AM - 23 Nov 21 UTC
bug
Team:VisEditors
Feature:Lens
impact:high
**Kibana version:** 7.15
**Describe the bug:** Time shift fails if some docum… ents in the index are using epoch_millis dates
<img width="648" alt="Screenshot 2021-11-23 at 11 50 09" src="https://user-images.githubusercontent.com/1508364/143011313-fb8e21b9-04b2-4f25-a845-d6dc386eff6f.png">
**Steps to reproduce:**
```
PUT /test
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"refresh_interval" : "1s"
}
},
"mappings" : {
"dynamic" : "strict",
"date_detection" : false,
"properties" : {
"timestamp" : {
"type" : "date",
"format" : "epoch_millis"
}
}
}
}
POST test/_doc/
{
"timestamp": 1636749579080
}
```
<img width="697" alt="Screenshot 2021-11-23 at 11 50 27" src="https://user-images.githubusercontent.com/1508364/143011277-e73c3ce5-0147-4834-8bd4-1c11748f319e.png">
**Any additional context:**
https://discuss.elastic.co/t/error-when-using-lens-with-time-shift/289802/3
This is happening because the filter building logic is not setting the `"format": "strict_date_optional_time"` property of the range filter.
Right now the only workaround is to only use time shift with `strict_date_time` dates.
opened 10:55AM - 23 Nov 21 UTC
bug
Team:VisEditors
Feature:Lens
impact:medium
**Kibana version:** 7.15
**Describe the bug:** Similar to https://github.com/… elastic/kibana/issues/119444, field existence fails if `epoch_millis` dates are used for the default time field of the index pattern
**Steps to reproduce:**
```
PUT /test
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"refresh_interval" : "1s"
}
},
"mappings" : {
"dynamic" : "strict",
"date_detection" : false,
"properties" : {
"timestamp" : {
"type" : "date",
"format" : "epoch_millis"
}
}
}
}
POST test/_doc/
{
"timestamp": 1636749579080
}
```
<img width="143" alt="Screenshot 2021-11-23 at 11 53 52" src="https://user-images.githubusercontent.com/1508364/143011747-0903f3bb-1fb9-4ff7-a87c-b2e0dee8776d.png">
**Any additional context:**
This is happening because the filter building logic is not setting the "format": "strict_date_optional_time" property of the range filter.
Right now the only workaround is to only use time shift with strict_date_time dates.
https://github.com/elastic/kibana/blob/1ac885e428f9fc1006d9908534370c642098019e/x-pack/plugins/lens/server/routes/existing_fields.ts#L186
https://github.com/elastic/kibana/issues/119444
We are going to fix them as soon as possible.
lifer
(Oleksii Samodid)
November 23, 2021, 11:51am
6
no problem, thanks for your support!
system
(system)
Closed
December 21, 2021, 11:52am
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.