mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Logs UI] Handle undefined composite key in category dataset response (#90472)
This fixes the handling of Elasticsearch responses that don't contain a composite key when querying for the available category datasets.
This commit is contained in:
parent
0fc9467e51
commit
874960e1c5
2 changed files with 7 additions and 4 deletions
|
@ -79,7 +79,7 @@ export async function getLatestLogEntriesCategoriesDatasetsStats(
|
|||
return {
|
||||
categorization_status: latestHitSource.categorization_status,
|
||||
categorized_doc_count: latestHitSource.categorized_doc_count,
|
||||
dataset: bucket.key.dataset ?? '',
|
||||
dataset: bucket.key?.dataset ?? '',
|
||||
dead_category_count: latestHitSource.dead_category_count,
|
||||
failed_category_count: latestHitSource.failed_category_count,
|
||||
frequent_category_count: latestHitSource.frequent_category_count,
|
||||
|
|
|
@ -98,9 +98,12 @@ export const logEntryCategorizerStatsHitRT = rt.type({
|
|||
|
||||
export type LogEntryCategorizerStatsHit = rt.TypeOf<typeof logEntryCategorizerStatsHitRT>;
|
||||
|
||||
const compositeDatasetKeyRT = rt.type({
|
||||
dataset: rt.union([rt.string, rt.null]),
|
||||
});
|
||||
const compositeDatasetKeyRT = rt.union([
|
||||
rt.type({
|
||||
dataset: rt.union([rt.string, rt.null]),
|
||||
}),
|
||||
rt.undefined,
|
||||
]);
|
||||
|
||||
export type CompositeDatasetKey = rt.TypeOf<typeof compositeDatasetKeyRT>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue