From 6c325c5d52ef82d214509d9aa97ecc488987ed94 Mon Sep 17 00:00:00 2001 From: Marco Antonio Ghiani Date: Mon, 15 Jan 2024 16:36:12 +0100 Subject: [PATCH] fix(log-shared): timestamp format --- .../top_categories/category_example_message.tsx | 6 ++++-- .../sections/anomalies/log_entry_example.tsx | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx index babd0e9a1ae3b..fda6dad009609 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx @@ -52,13 +52,15 @@ export const CategoryExampleMessage: React.FunctionComponent<{ const openMenu = useCallback(() => setIsMenuOpen(true), []); const closeMenu = useCallback(() => setIsMenuOpen(false), []); + const time = moment(timestamp).toISOString(); + const viewInStreamLinkProps = useLinkProps({ app: 'logs', pathname: 'stream', search: { logPosition: encode({ end: moment(timeRange.endTime).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), - position: { tiebreaker, time: moment(timestamp).toISOString() }, + position: { tiebreaker, time }, start: moment(timeRange.startTime).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), streamLive: false, }), @@ -79,7 +81,7 @@ export const CategoryExampleMessage: React.FunctionComponent<{ onMouseLeave={setNotHovered} > - + = ({ // handle special cases for the dataset value const humanFriendlyDataset = getFriendlyNameForPartitionId(dataset); + const time = moment(timestamp).toISOString(); + const viewInStreamLinkProps = useLinkProps({ app: 'logs', pathname: 'stream', search: { logPosition: encode({ end: moment(timeRange.endTime).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), - position: { tiebreaker, time: moment(timestamp).toISOString() }, + position: { tiebreaker, time }, start: moment(timeRange.startTime).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), streamLive: false, }), @@ -182,7 +184,7 @@ export const LogEntryExampleMessage: React.FunctionComponent = ({ onMouseLeave={setItemIsNotHovered} > - + - Message + {i18n.translate( + 'xpack.infra.logEntryExampleMessageHeaders.logColumnHeader.messageLabel', + { defaultMessage: 'Message' } + )} ); } else if (isFieldLogColumnConfiguration(columnConfiguration)) {