[DataView] Improve automatic timeFieldName selection #153872
Labels
enhancement
New value added to drive a business result
Feature:Discover
Discover Application
Icebox
impact:low
Addressing this issue will have a low level of impact on the quality/strength of our product.
loe:medium
Medium Level of Effort
Team:DataDiscovery
Discover App Team (Document Explorer, Saved Search, Surrounding documents, Data, DataViews)
When creating a ad-hoc data view in the UI in a quick way, not using the flyout, there's a check if there's a
@timestamp
field available with the right mapping. In this case this is automatically selected astimeFieldName
in the create data view. This logic is duplicated in several places. So it should be centralized (e.g. as a helper function indataViews
or a method of a data view instance).Here's some code using this logic:
kibana/src/plugins/discover/public/application/main/services/discover_state.ts
Line 399 in 2d8a2b5
kibana/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx
Line 944 in 2ed0123
kibana/x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx
Line 129 in 32cf768
Furthermore this logic could be improved to
@timestamp
... e.g.timestamp
On the long run, it would be helpful to suggest matching fields for timeFieldName, and let the user select it. Or maybe also allow to quickly switch the time field in the field list.
Surfaced in #152640 (comment) index pattern management would also be a good candidate for applying the shared logic
The text was updated successfully, but these errors were encountered: