I have a trouble with when I want to select documents from an index pattern by their Time field
using time picker and visualize a date histogram on another datetime field.
- I created an index and an index pattern with Time field on
CREATE_DATE
.
PUT test_two_date_fields
{
"mappings": {
"properties": {
"CREATE_DATE":{"type":"date"},
"UPDATE_DATE":{"type":"date"},
"TYPE": {"type": "keyword"}
}
}
}
POST test_two_date_fields/_doc
{
"CREATE_DATE": "2022-05-01",
"UPDATE_DATE": "2022-06-01",
"TYPE": "A"
}
POST test_two_date_fields/_doc
{
"CREATE_DATE": "2022-05-02",
"UPDATE_DATE": "2022-05-02",
"TYPE": "A"
}
POST test_two_date_fields/_doc
{
"CREATE_DATE": "2022-05-03",
"UPDATE_DATE": "2022-05-04",
"TYPE": "B"
}
-
First, when using Discover, of course time picker filter documents by the
Time field
(here:CREATE_DATE
) of the index pattern.
-
Using Lens, if I want to visualize a date histogram for
UPDATE_DATE
with filtering by theTime field
(CREATE_DATE
) using time_picker, I get the time picker applied not onTime field
but on the plot's X-axis:UPDATE_DATE
.
-
With "Aggregation based", even if a Date Histogram of a datetime field is set on X-axis buckets, the time-picker filters the documents by the
Time field
of the index pattern. The range of the x-axis is automatically fit to the min/max of the field.
The behavior between 2. and 3. is not consistent and I feel it a little strange that the time picker works for filtering on X-axis just when the X-axis is a datetime field. The group of documents will be different between multiple visualizations on a single dashboard. Is there any option to dislink time picker and X-axis of Lens?