mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[DataStreamAdapter] Remove alerts-as-data package dependency (#178127)
## Summary A jest test had a `alerts-as-data-util` dependency. Cleaned.
This commit is contained in:
parent
544ce1ac16
commit
fe97a7a56e
2 changed files with 1 additions and 198 deletions
|
@ -6,8 +6,8 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { alertFieldMap, legacyAlertFieldMap, type FieldMap } from '@kbn/alerts-as-data-utils';
|
||||
import { mappingFromFieldMap } from './mapping_from_field_map';
|
||||
import type { FieldMap } from './types';
|
||||
|
||||
export const testFieldMap: FieldMap = {
|
||||
date_field: {
|
||||
|
@ -186,202 +186,6 @@ describe('mappingFromFieldMap', () => {
|
|||
dynamic: 'strict',
|
||||
...expectedTestMapping,
|
||||
});
|
||||
expect(mappingFromFieldMap(alertFieldMap)).toEqual({
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
'@timestamp': {
|
||||
ignore_malformed: false,
|
||||
type: 'date',
|
||||
},
|
||||
event: {
|
||||
properties: {
|
||||
action: {
|
||||
type: 'keyword',
|
||||
},
|
||||
kind: {
|
||||
type: 'keyword',
|
||||
},
|
||||
},
|
||||
},
|
||||
kibana: {
|
||||
properties: {
|
||||
alert: {
|
||||
properties: {
|
||||
action_group: {
|
||||
type: 'keyword',
|
||||
},
|
||||
case_ids: {
|
||||
type: 'keyword',
|
||||
},
|
||||
duration: {
|
||||
properties: {
|
||||
us: {
|
||||
type: 'long',
|
||||
},
|
||||
},
|
||||
},
|
||||
end: {
|
||||
type: 'date',
|
||||
},
|
||||
flapping: {
|
||||
type: 'boolean',
|
||||
},
|
||||
flapping_history: {
|
||||
type: 'boolean',
|
||||
},
|
||||
maintenance_window_ids: {
|
||||
type: 'keyword',
|
||||
},
|
||||
instance: {
|
||||
properties: {
|
||||
id: {
|
||||
type: 'keyword',
|
||||
},
|
||||
},
|
||||
},
|
||||
last_detected: {
|
||||
type: 'date',
|
||||
},
|
||||
reason: {
|
||||
fields: {
|
||||
text: {
|
||||
type: 'match_only_text',
|
||||
},
|
||||
},
|
||||
type: 'keyword',
|
||||
},
|
||||
rule: {
|
||||
properties: {
|
||||
category: {
|
||||
type: 'keyword',
|
||||
},
|
||||
consumer: {
|
||||
type: 'keyword',
|
||||
},
|
||||
execution: {
|
||||
properties: {
|
||||
uuid: {
|
||||
type: 'keyword',
|
||||
},
|
||||
},
|
||||
},
|
||||
name: {
|
||||
type: 'keyword',
|
||||
},
|
||||
parameters: {
|
||||
type: 'flattened',
|
||||
ignore_above: 4096,
|
||||
},
|
||||
producer: {
|
||||
type: 'keyword',
|
||||
},
|
||||
revision: {
|
||||
type: 'long',
|
||||
},
|
||||
rule_type_id: {
|
||||
type: 'keyword',
|
||||
},
|
||||
tags: {
|
||||
type: 'keyword',
|
||||
},
|
||||
uuid: {
|
||||
type: 'keyword',
|
||||
},
|
||||
},
|
||||
},
|
||||
start: {
|
||||
type: 'date',
|
||||
},
|
||||
status: {
|
||||
type: 'keyword',
|
||||
},
|
||||
time_range: {
|
||||
type: 'date_range',
|
||||
format: 'epoch_millis||strict_date_optional_time',
|
||||
},
|
||||
url: {
|
||||
ignore_above: 2048,
|
||||
index: false,
|
||||
type: 'keyword',
|
||||
},
|
||||
uuid: {
|
||||
type: 'keyword',
|
||||
},
|
||||
workflow_assignee_ids: {
|
||||
type: 'keyword',
|
||||
},
|
||||
workflow_status: {
|
||||
type: 'keyword',
|
||||
},
|
||||
workflow_tags: {
|
||||
type: 'keyword',
|
||||
},
|
||||
},
|
||||
},
|
||||
space_ids: {
|
||||
type: 'keyword',
|
||||
},
|
||||
version: {
|
||||
type: 'version',
|
||||
},
|
||||
},
|
||||
},
|
||||
tags: {
|
||||
type: 'keyword',
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(mappingFromFieldMap(legacyAlertFieldMap)).toEqual({
|
||||
dynamic: 'strict',
|
||||
properties: {
|
||||
kibana: {
|
||||
properties: {
|
||||
alert: {
|
||||
properties: {
|
||||
risk_score: { type: 'float' },
|
||||
rule: {
|
||||
properties: {
|
||||
author: { type: 'keyword' },
|
||||
created_at: { type: 'date' },
|
||||
created_by: { type: 'keyword' },
|
||||
description: { type: 'keyword' },
|
||||
enabled: { type: 'keyword' },
|
||||
from: { type: 'keyword' },
|
||||
interval: { type: 'keyword' },
|
||||
license: { type: 'keyword' },
|
||||
note: { type: 'keyword' },
|
||||
references: { type: 'keyword' },
|
||||
rule_id: { type: 'keyword' },
|
||||
rule_name_override: { type: 'keyword' },
|
||||
to: { type: 'keyword' },
|
||||
type: { type: 'keyword' },
|
||||
updated_at: { type: 'date' },
|
||||
updated_by: { type: 'keyword' },
|
||||
version: { type: 'keyword' },
|
||||
},
|
||||
},
|
||||
severity: { type: 'keyword' },
|
||||
suppression: {
|
||||
properties: {
|
||||
docs_count: { type: 'long' },
|
||||
end: { type: 'date' },
|
||||
terms: {
|
||||
properties: { field: { type: 'keyword' }, value: { type: 'keyword' } },
|
||||
},
|
||||
start: { type: 'date' },
|
||||
},
|
||||
},
|
||||
system_status: { type: 'keyword' },
|
||||
workflow_reason: { type: 'keyword' },
|
||||
workflow_status_updated_at: { type: 'date' },
|
||||
workflow_user: { type: 'keyword' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ecs: { properties: { version: { type: 'keyword' } } },
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('uses dynamic setting if specified', () => {
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
"kbn_references": [
|
||||
"@kbn/core",
|
||||
"@kbn/std",
|
||||
"@kbn/alerts-as-data-utils",
|
||||
"@kbn/safer-lodash-set",
|
||||
"@kbn/logging-mocks",
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue