Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RAM] kibana.alert.url #155309

Merged
merged 7 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,
},
Comment on lines +159 to +165
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we intentionally making this field doc values only? What are the intended use cases for this field mapping?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed, we are not going to search on this field, it is just for representation.

[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