forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Fixing results for unknown fields (elastic#24577) (elastic#24632)
* [Ml] Fixing results for known fields * renaming known-type to unknown * correcting comments * tiny refactor
- Loading branch information
1 parent
23d89c8
commit c6929fe
Showing
14 changed files
with
165 additions
and
66 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -34,7 +34,7 @@ | |
background-color: #920000; | ||
} | ||
|
||
.type-other { | ||
.type-other, .unknown { | ||
background-color: #bfa180; | ||
} | ||
|
||
|
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
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
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
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
7 changes: 7 additions & 0 deletions
7
...gins/ml/public/file_datavisualizer/components/experimental_badge/_experimental_badge.scss
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,7 @@ | ||
.ml-experimental-badge.euiBetaBadge { | ||
font-size: 10px; | ||
vertical-align: middle; | ||
margin-bottom: 5px; | ||
padding: 0px 20px; | ||
line-height: 20px; | ||
} |
1 change: 1 addition & 0 deletions
1
x-pack/plugins/ml/public/file_datavisualizer/components/experimental_badge/_index.scss
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 @@ | ||
@import 'experimental_badge' |
19 changes: 19 additions & 0 deletions
19
...plugins/ml/public/file_datavisualizer/components/experimental_badge/experimental_badge.js
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,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { | ||
EuiBetaBadge, | ||
} from '@elastic/eui'; | ||
|
||
export function ExperimentalBadge({ tooltipContent }) { | ||
return ( | ||
<span> | ||
<EuiBetaBadge className="ml-experimental-badge" label="Experimental" tooltipContent={tooltipContent} /> | ||
</span> | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/ml/public/file_datavisualizer/components/experimental_badge/index.js
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,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
|
||
export { ExperimentalBadge } from './experimental_badge'; |
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
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
37 changes: 37 additions & 0 deletions
37
x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/get_field_names.js
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,37 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
|
||
import { difference } from 'lodash'; | ||
|
||
export function getFieldNames(results) { | ||
const { | ||
mappings, | ||
field_stats: fieldStats, | ||
column_names: columnNames, | ||
} = results; | ||
|
||
// if columnNames exists (i.e delimited) use it for the field list | ||
// so we get the same order | ||
const tempFields = (columnNames !== undefined) ? columnNames : Object.keys(fieldStats); | ||
|
||
|
||
// there may be fields in the mappings which do not exist in the field_stats | ||
// e.g. the message field for a semi-structured log file, as they have no stats. | ||
// add any extra fields to the list | ||
const differenceFields = difference(Object.keys(mappings), tempFields); | ||
|
||
// except @timestamp | ||
const timestampIndex = differenceFields.indexOf('@timestamp'); | ||
if (timestampIndex !== -1) { | ||
differenceFields.splice(timestampIndex, 1); | ||
} | ||
|
||
if (differenceFields.length) { | ||
tempFields.push(...differenceFields); | ||
} | ||
return tempFields; | ||
} |
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