From f6f7c2d1dee69dfe7f2ca795d37b8f5e8134381f Mon Sep 17 00:00:00 2001 From: Shivindera Singh Date: Mon, 1 Nov 2021 16:08:08 +0100 Subject: [PATCH] [AppServices] @timestamp as default for timestamp field name in index pattern (#25863) (#116126) --- .../public/components/form_fields/timestamp_field.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/index_pattern_editor/public/components/form_fields/timestamp_field.tsx b/src/plugins/index_pattern_editor/public/components/form_fields/timestamp_field.tsx index e034ccd13134..dd9d4f711745 100644 --- a/src/plugins/index_pattern_editor/public/components/form_fields/timestamp_field.tsx +++ b/src/plugins/index_pattern_editor/public/components/form_fields/timestamp_field.tsx @@ -105,6 +105,13 @@ export const TimestampField = ({ const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field); const isDisabled = !optionsAsComboBoxOptions.length; + if (!value && !isDisabled) { + const val = optionsAsComboBoxOptions.filter((el) => el.value === '@timestamp'); + if (val.length) { + setValue(val[0]); + } + } + return ( <>