Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] [AIOps] Log Rate Analysis: Show top N results when no docs in ba…
…seline or deviation. (#171924) This PR adds a fallback analysis when either the baseline or deviation time range contains no documents. Instead of trying to fetch significant items (which would return no results), this will just fetch the top terms/categories for the time range that has some documents.
- Loading branch information
Showing
43 changed files
with
2,967 additions
and
480 deletions.
There are no files selected for viewing
142 changes: 142 additions & 0 deletions
142
x-pack/plugins/aiops/common/__mocks__/artificial_logs/top_terms.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { SignificantItem } from '@kbn/ml-agg-utils'; | ||
|
||
// Named topTerms since all these items are of type `keyword`. | ||
export const topTerms: SignificantItem[] = [ | ||
{ | ||
bg_count: 0, | ||
doc_count: 5102, | ||
fieldName: 'version', | ||
fieldValue: 'v1.0.0', | ||
key: 'version:v1.0.0', | ||
normalizedScore: 0, | ||
pValue: 1, | ||
score: 0, | ||
total_bg_count: 0, | ||
total_doc_count: 0, | ||
type: 'keyword', | ||
}, | ||
{ | ||
bg_count: 0, | ||
doc_count: 2272, | ||
fieldName: 'response_code', | ||
fieldValue: '500', | ||
key: 'response_code:500', | ||
normalizedScore: 0, | ||
pValue: 1, | ||
score: 0, | ||
total_bg_count: 0, | ||
total_doc_count: 0, | ||
type: 'keyword', | ||
}, | ||
{ | ||
bg_count: 0, | ||
doc_count: 2197, | ||
fieldName: 'url', | ||
fieldValue: 'home.php', | ||
key: 'url:home.php', | ||
normalizedScore: 0, | ||
pValue: 1, | ||
score: 0, | ||
total_bg_count: 0, | ||
total_doc_count: 0, | ||
type: 'keyword', | ||
}, | ||
{ | ||
bg_count: 0, | ||
doc_count: 1981, | ||
fieldName: 'user', | ||
fieldValue: 'Peter', | ||
key: 'user:Peter', | ||
normalizedScore: 0, | ||
pValue: 1, | ||
score: 0, | ||
total_bg_count: 0, | ||
total_doc_count: 0, | ||
type: 'keyword', | ||
}, | ||
{ | ||
bg_count: 0, | ||
doc_count: 1773, | ||
fieldName: 'user', | ||
fieldValue: 'Paul', | ||
key: 'user:Paul', | ||
normalizedScore: 0, | ||
pValue: 1, | ||
score: 0, | ||
total_bg_count: 0, | ||
total_doc_count: 0, | ||
type: 'keyword', | ||
}, | ||
{ | ||
bg_count: 0, | ||
doc_count: 1574, | ||
fieldName: 'url', | ||
fieldValue: 'login.php', | ||
key: 'url:login.php', | ||
normalizedScore: 0, | ||
pValue: 1, | ||
score: 0, | ||
total_bg_count: 0, | ||
total_doc_count: 0, | ||
type: 'keyword', | ||
}, | ||
{ | ||
bg_count: 0, | ||
doc_count: 1569, | ||
fieldName: 'response_code', | ||
fieldValue: '404', | ||
key: 'response_code:404', | ||
normalizedScore: 0, | ||
pValue: 1, | ||
score: 0, | ||
total_bg_count: 0, | ||
total_doc_count: 0, | ||
type: 'keyword', | ||
}, | ||
{ | ||
bg_count: 0, | ||
doc_count: 1348, | ||
fieldName: 'user', | ||
fieldValue: 'Mary', | ||
key: 'user:Mary', | ||
normalizedScore: 0, | ||
pValue: 1, | ||
score: 0, | ||
total_bg_count: 0, | ||
total_doc_count: 0, | ||
type: 'keyword', | ||
}, | ||
{ | ||
bg_count: 0, | ||
doc_count: 1331, | ||
fieldName: 'url', | ||
fieldValue: 'user.php', | ||
key: 'url:user.php', | ||
normalizedScore: 0, | ||
pValue: 1, | ||
score: 0, | ||
total_bg_count: 0, | ||
total_doc_count: 0, | ||
type: 'keyword', | ||
}, | ||
{ | ||
bg_count: 0, | ||
doc_count: 1261, | ||
fieldName: 'response_code', | ||
fieldValue: '200', | ||
key: 'response_code:200', | ||
normalizedScore: 0, | ||
pValue: 1, | ||
score: 0, | ||
total_bg_count: 0, | ||
total_doc_count: 0, | ||
type: 'keyword', | ||
}, | ||
]; |
Oops, something went wrong.