mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Alert As Data] Add match_only_text mapping for reason field (#171969)
This commit is contained in:
parent
e64f475a01
commit
42253b6aba
4 changed files with 26 additions and 0 deletions
|
@ -41,6 +41,7 @@ import {
|
|||
EVENT_KIND,
|
||||
TAGS,
|
||||
} from '@kbn/rule-data-utils';
|
||||
import { MultiField } from './types';
|
||||
|
||||
export const alertFieldMap = {
|
||||
[ALERT_ACTION_GROUP]: {
|
||||
|
@ -92,6 +93,13 @@ export const alertFieldMap = {
|
|||
type: 'keyword',
|
||||
array: false,
|
||||
required: false,
|
||||
multi_fields: [
|
||||
{
|
||||
flat_name: `${ALERT_REASON}.text`,
|
||||
name: 'text',
|
||||
type: 'match_only_text',
|
||||
},
|
||||
] as MultiField[],
|
||||
},
|
||||
[ALERT_RULE_CATEGORY]: {
|
||||
type: 'keyword',
|
||||
|
|
|
@ -242,6 +242,11 @@ describe('mappingFromFieldMap', () => {
|
|||
},
|
||||
reason: {
|
||||
type: 'keyword',
|
||||
fields: {
|
||||
text: {
|
||||
type: 'match_only_text',
|
||||
},
|
||||
},
|
||||
},
|
||||
rule: {
|
||||
properties: {
|
||||
|
|
|
@ -79,6 +79,13 @@ it('matches snapshot', () => {
|
|||
},
|
||||
"kibana.alert.reason": Object {
|
||||
"array": false,
|
||||
"multi_fields": Array [
|
||||
Object {
|
||||
"flat_name": "kibana.alert.reason.text",
|
||||
"name": "text",
|
||||
"type": "match_only_text",
|
||||
},
|
||||
],
|
||||
"required": false,
|
||||
"type": "keyword",
|
||||
},
|
||||
|
|
|
@ -26,6 +26,9 @@ Object {
|
|||
"kibana.alert.reason": Array [
|
||||
"Failed transactions is 50% in the last 5 mins for service: opbeans-go, env: Not defined, type: request. Alert when > 30%.",
|
||||
],
|
||||
"kibana.alert.reason.text": Array [
|
||||
"Failed transactions is 50% in the last 5 mins for service: opbeans-go, env: Not defined, type: request. Alert when > 30%.",
|
||||
],
|
||||
"kibana.alert.rule.category": Array [
|
||||
"Failed transaction rate threshold",
|
||||
],
|
||||
|
@ -109,6 +112,9 @@ Object {
|
|||
"kibana.alert.reason": Array [
|
||||
"Failed transactions is 50% in the last 5 mins for service: opbeans-go, env: Not defined, type: request. Alert when > 30%.",
|
||||
],
|
||||
"kibana.alert.reason.text": Array [
|
||||
"Failed transactions is 50% in the last 5 mins for service: opbeans-go, env: Not defined, type: request. Alert when > 30%.",
|
||||
],
|
||||
"kibana.alert.rule.category": Array [
|
||||
"Failed transaction rate threshold",
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue