Skip to content

Commit 160d01c

Browse files
author
Alejandro Fernández Gómez
committed
Fix types
1 parent 7c9065c commit 160d01c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import type { IScopedClusterClient } from 'src/core/server';
8+
import { LogEntryContext } from '../../../common/http_api';
89
import {
910
compareDatasetsByMaximumAnomalyScore,
1011
getJobId,
@@ -523,7 +524,7 @@ async function fetchLogEntryCategoryExamples(
523524

524525
const parseCategoryId = (rawCategoryId: string) => parseInt(rawCategoryId, 10);
525526

526-
const getContextFromSource = (source: any) => {
527+
const getContextFromSource = (source: any): LogEntryContext => {
527528
const containerId = source.container?.id;
528529
const hostName = source.host?.name;
529530
const logFilePath = source.log?.file?.path;
@@ -535,6 +536,8 @@ const getContextFromSource = (source: any) => {
535536
if (typeof hostName === 'string' && typeof logFilePath === 'string') {
536537
return { 'host.name': hostName, 'log.file.path': logFilePath };
537538
}
539+
540+
return {};
538541
};
539542

540543
interface HistogramParameters {

0 commit comments

Comments
 (0)