Skip to content

Commit

Permalink
[RAM] kibana.alert.url (#155309)
Browse files Browse the repository at this point in the history
Add alert url as data to allow our user to go back to the details url in
kibana
  • Loading branch information
XavierM committed Apr 20, 2023
1 parent 45f102f commit 59f8635
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
ALERT_START,
ALERT_STATUS,
ALERT_TIME_RANGE,
ALERT_URL,
ALERT_UUID,
ALERT_WORKFLOW_STATUS,
SPACE_IDS,
Expand Down Expand Up @@ -155,6 +156,13 @@ export const alertFieldMap = {
array: false,
required: false,
},
[ALERT_URL]: {
type: 'keyword',
array: false,
index: false,
required: false,
ignore_above: 2048,
},
[ALERT_UUID]: {
type: 'keyword',
array: false,
Expand Down
5 changes: 5 additions & 0 deletions packages/kbn-rule-data-utils/src/default_alerts_as_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ const ALERT_RULE_TAGS = `${ALERT_RULE_NAMESPACE}.tags` as const;
// kibana.alert.rule_type_id - rule type id for rule that generated this alert
const ALERT_RULE_TYPE_ID = `${ALERT_RULE_NAMESPACE}.rule_type_id` as const;

// kibana.alert.url - allow our user to go back to the details url in kibana
const ALERT_URL = `${ALERT_NAMESPACE}.url` as const;

// kibana.alert.rule.uuid - rule ID for rule that generated this alert
const ALERT_RULE_UUID = `${ALERT_RULE_NAMESPACE}.uuid` as const;

Expand Down Expand Up @@ -127,6 +130,7 @@ const fields = {
ALERT_START,
ALERT_STATUS,
ALERT_TIME_RANGE,
ALERT_URL,
ALERT_UUID,
ALERT_WORKFLOW_STATUS,
SPACE_IDS,
Expand Down Expand Up @@ -164,6 +168,7 @@ export {
ALERT_START,
ALERT_STATUS,
ALERT_TIME_RANGE,
ALERT_URL,
ALERT_UUID,
ALERT_WORKFLOW_STATUS,
SPACE_IDS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ describe('mappingFromFieldMap', () => {
type: 'date_range',
format: 'epoch_millis||strict_date_optional_time',
},
url: {
ignore_above: 2048,
index: false,
type: 'keyword',
},
uuid: {
type: 'keyword',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,13 @@ it('matches snapshot', () => {
"required": false,
"type": "date_range",
},
"kibana.alert.url": Object {
"array": false,
"ignore_above": 2048,
"index": false,
"required": false,
"type": "keyword",
},
"kibana.alert.uuid": Object {
"array": false,
"required": true,
Expand Down

0 comments on commit 59f8635

Please sign in to comment.