Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
80b48fa
Add aggregated ap status
nkhristinin Nov 11, 2025
ceb9efb
Changes from yarn openapi:bundle
kibanamachine Nov 11, 2025
fa4df71
fix ci
nkhristinin Nov 11, 2025
14d3aa1
Changes from make api-docs
kibanamachine Nov 11, 2025
2563e6d
add aggregated status in query
nkhristinin Nov 12, 2025
ae8957a
fix tests
nkhristinin Nov 12, 2025
c2875a8
add persistence logic
nkhristinin Nov 12, 2025
e855c2c
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Nov 12, 2025
45be9ce
fix tests
nkhristinin Nov 12, 2025
7487c87
return aggs names
nkhristinin Nov 13, 2025
866502b
clean up
nkhristinin Nov 13, 2025
fff6356
fix open api
nkhristinin Nov 13, 2025
9bd2edd
clean up
nkhristinin Nov 13, 2025
ac40100
Changes from yarn openapi:bundle
kibanamachine Nov 13, 2025
ba4dac0
Changes from make api-docs
kibanamachine Nov 13, 2025
7823b31
Merge branch 'main' into rules-with-gap-status
elasticmachine Nov 14, 2025
b298b8f
fix tests
nkhristinin Nov 14, 2025
161fce4
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Nov 14, 2025
ea6761d
Merge branch 'main' into rules-with-gap-status
elasticmachine Nov 18, 2025
7fea0ee
make 90 days default gap range
nkhristinin Nov 19, 2025
781f918
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Nov 19, 2025
cc5d324
Change in DE aggregated gap status to gap fill status
nkhristinin Nov 20, 2025
56f8f33
Rename to GapFillStatus
nkhristinin Nov 20, 2025
58a564c
Changes from yarn openapi:bundle
kibanamachine Nov 20, 2025
5ef908e
Changes from make api-docs
kibanamachine Nov 20, 2025
d6acab4
Rename to highest priority gap gill status
nkhristinin Nov 20, 2025
db21de9
Merge branch 'main' into rules-with-gap-status
elasticmachine Nov 20, 2025
d023c10
Rename to gap fill status in response
nkhristinin Nov 20, 2025
f20f19e
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Nov 20, 2025
4bf14ea
Add comments for statuses
nkhristinin Nov 21, 2025
5d0d8d4
Split unit tests
nkhristinin Nov 21, 2025
40fa19b
Derrive GapDurationBucket from RULE_GAP_AGGREGATIONS
nkhristinin Nov 21, 2025
db3ca63
Set default value for highestPriorityGapFillStatuses
nkhristinin Nov 21, 2025
323160a
Remove default undefined value
nkhristinin Nov 21, 2025
9010034
Extract hasMatchedGapFillStatus to utils function
nkhristinin Nov 21, 2025
2d9a134
Use common types for aggregations
nkhristinin Nov 21, 2025
ab090dc
Don't use empty string by deafult for gap_fill_status
nkhristinin Nov 21, 2025
2b777c7
Use use boolean
nkhristinin Nov 21, 2025
806f4c1
Use a common tyoe for gap fill status column
nkhristinin Nov 21, 2025
7ac3e51
Extract gap fill status tooltip into different component
nkhristinin Nov 21, 2025
1af566f
Align validation
nkhristinin Nov 21, 2025
595db05
Extract gap params to another function, to remove complexity
nkhristinin Nov 21, 2025
03800ec
fix tests
nkhristinin Nov 21, 2025
e7aeac4
use common enum for gap fill status
nkhristinin Nov 21, 2025
b9b2790
fix tests
nkhristinin Nov 21, 2025
176cce6
Merge branch 'main' into rules-with-gap-status
maximpn Nov 24, 2025
0a3eec8
reset gap fill status filter and not store in URL
nkhristinin Dec 3, 2025
c834619
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Dec 3, 2025
266ca48
Merge branch 'main' into rules-with-gap-status
nkhristinin Dec 3, 2025
e01520d
Update x-pack/solutions/security/plugins/security_solution/public/det…
nkhristinin Dec 3, 2025
4d67f8b
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Dec 3, 2025
9d8cdca
renamame function
nkhristinin Dec 3, 2025
cdce191
Move utils to to common folder
nkhristinin Dec 3, 2025
099b792
Change docs description
nkhristinin Dec 3, 2025
82062ee
Merge branch 'rules-with-gap-status' of github.com:nkhristinin/kibana…
nkhristinin Dec 3, 2025
d6ec8ed
Changes from yarn openapi:bundle
kibanamachine Dec 3, 2025
7747db4
Changes from make api-docs
kibanamachine Dec 3, 2025
15167f5
avoid unecessary filter change
nkhristinin Dec 4, 2025
651f2b9
Merge branch 'main' into rules-with-gap-status
maximpn Dec 4, 2025
f091826
Merge branch 'main' into rules-with-gap-status
elasticmachine Dec 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14306,6 +14306,14 @@ paths:
required: false
schema:
type: string
- description: Gap fill statuses
in: query
name: gap_fill_statuses
required: false
schema:
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
responses:
'200':
content:
Expand Down Expand Up @@ -84145,6 +84153,11 @@ components:
enum:
- delete
type: string
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand All @@ -84171,6 +84184,11 @@ components:
enum:
- disable
type: string
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -84210,6 +84228,11 @@ components:
required:
- include_exceptions
- include_expired_exceptions
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -84310,6 +84333,11 @@ components:
$ref: '#/components/schemas/Security_Detections_API_BulkActionEditPayload'
minItems: 1
type: array
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -84341,6 +84369,11 @@ components:
enum:
- enable
type: string
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -84369,6 +84402,11 @@ components:
enum:
- export
type: string
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -84412,6 +84450,11 @@ components:
required:
- start_date
- end_date
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -84439,6 +84482,11 @@ components:
enum:
- run
type: string
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -85607,6 +85655,12 @@ components:
- updated_at
- updatedAt
type: string
Security_Detections_API_GapFillStatus:
enum:
- unfilled
- in_progress
- filled
type: string
Security_Detections_API_HistoryWindowStart:
description: Start date to use when checking if a term has been seen before. Supports relative dates – for example, now-30d will search the last 30 days of data when checking if a term is new. We do not recommend using absolute dates, which can cause issues with rule performance due to querying increasing amounts of data over time.
format: nonempty
Expand Down
54 changes: 54 additions & 0 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16237,6 +16237,14 @@ paths:
required: false
schema:
type: string
- description: Gap fill statuses
in: query
name: gap_fill_statuses
required: false
schema:
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
responses:
'200':
content:
Expand Down Expand Up @@ -94719,6 +94727,11 @@ components:
enum:
- delete
type: string
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand All @@ -94745,6 +94758,11 @@ components:
enum:
- disable
type: string
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -94784,6 +94802,11 @@ components:
required:
- include_exceptions
- include_expired_exceptions
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -94884,6 +94907,11 @@ components:
$ref: '#/components/schemas/Security_Detections_API_BulkActionEditPayload'
minItems: 1
type: array
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -94915,6 +94943,11 @@ components:
enum:
- enable
type: string
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -94943,6 +94976,11 @@ components:
enum:
- export
type: string
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -94986,6 +95024,11 @@ components:
required:
- start_date
- end_date
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -95013,6 +95056,11 @@ components:
enum:
- run
type: string
gap_fill_statuses:
description: Gap fill statuses to filter rules with gaps by status (used together with gaps_range_*).
items:
$ref: '#/components/schemas/Security_Detections_API_GapFillStatus'
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
Expand Down Expand Up @@ -96181,6 +96229,12 @@ components:
- updated_at
- updatedAt
type: string
Security_Detections_API_GapFillStatus:
enum:
- unfilled
- in_progress
- filled
type: string
Security_Detections_API_HistoryWindowStart:
description: Start date to use when checking if a term has been seen before. Supports relative dates – for example, now-30d will search the last 30 days of data when checking if a term is new. We do not recommend using absolute dates, which can cause issues with rule performance due to querying increasing amounts of data over time.
format: nonempty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38313,11 +38313,6 @@
"xpack.securitySolution.ruleExceptions.logic.closeAlerts.error": "Alerts konnten nicht geschlossen werden",
"xpack.securitySolution.ruleFromTimeline.error.title": "Regel konnte nicht aus der Zeitleiste importiert werden",
"xpack.securitySolution.ruleFromTimeline.error.toastMessage": "Fehler beim Erstellen einer Regel aus der Zeitachse mit der ID: {id}",
"xpack.securitySolution.ruleGapsOverviewPanel.label": "Gesamtanzahl der Regeln mit Lücken:",
"xpack.securitySolution.ruleGapsOverviewPanel.last24HoursLabel": "Letzte 24 Stunden",
"xpack.securitySolution.ruleGapsOverviewPanel.last3DaysLabel": "Letzte 3 Tage",
"xpack.securitySolution.ruleGapsOverviewPanel.last7DaysLabel": "Letzte 7 Tage",
"xpack.securitySolution.ruleGapsOverviewPanel.showRulesWithGapsLabel": "Nur Regeln mit Lücken",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipContent": "Sehen Sie sich unser {createEsqlRuleTypeLink} an, um mit der Nutzung der ES|QL-Regeln zu beginnen.",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipLink": "Dokumentation",
"xpack.securitySolution.ruleManagement.esqlValidation.errorMessage": "Fehler bei der Validierung von ES|QL: \"{message}\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38682,11 +38682,6 @@
"xpack.securitySolution.ruleExceptions.logic.closeAlerts.success": "Mise à jour réussie de {numAlerts} {numAlerts, plural, =1 {alert} other {alertes}}",
"xpack.securitySolution.ruleFromTimeline.error.title": "Échec de l'importation de la règle à partir de la chronologie",
"xpack.securitySolution.ruleFromTimeline.error.toastMessage": "Impossible de créer la règle à partir de la chronologie avec l'ID : {id}",
"xpack.securitySolution.ruleGapsOverviewPanel.label": "Nombre total de règles avec des écarts :",
"xpack.securitySolution.ruleGapsOverviewPanel.last24HoursLabel": "Dernières 24 heures",
"xpack.securitySolution.ruleGapsOverviewPanel.last3DaysLabel": "3 derniers jours",
"xpack.securitySolution.ruleGapsOverviewPanel.last7DaysLabel": "7 derniers jours",
"xpack.securitySolution.ruleGapsOverviewPanel.showRulesWithGapsLabel": "Seulement les règles avec des écarts",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipContent": "Consultez {createEsqlRuleTypeLink} pour commencer à utiliser les règles ES|QL.",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipLink": "documentation",
"xpack.securitySolution.ruleManagement.esqlValidation.errorMessage": "Erreur lors de la validation ES|QL : \"{message}\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38721,11 +38721,6 @@
"xpack.securitySolution.ruleExceptions.logic.closeAlerts.success": "{numAlerts} {numAlerts, plural, =1 {alert} other {件のアラート}}が正常に更新されました",
"xpack.securitySolution.ruleFromTimeline.error.title": "タイムラインからルールをインポートできませんでした",
"xpack.securitySolution.ruleFromTimeline.error.toastMessage": "次のIDでタイムラインからのルール作成に失敗しました:{id}",
"xpack.securitySolution.ruleGapsOverviewPanel.label": "ギャップがあるルールの合計数:",
"xpack.securitySolution.ruleGapsOverviewPanel.last24HoursLabel": "過去 24 時間",
"xpack.securitySolution.ruleGapsOverviewPanel.last3DaysLabel": "過去3日間",
"xpack.securitySolution.ruleGapsOverviewPanel.last7DaysLabel": "過去 7 日間",
"xpack.securitySolution.ruleGapsOverviewPanel.showRulesWithGapsLabel": "ギャップがあるルールのみ",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipContent": "ES|QL ルールの使用を開始するには、{createEsqlRuleTypeLink}を確認してください。",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipLink": "ドキュメンテーション",
"xpack.securitySolution.ruleManagement.esqlValidation.errorMessage": "ES|QLの検証エラー:\"{message}\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38701,11 +38701,6 @@
"xpack.securitySolution.ruleExceptions.logic.closeAlerts.success": "已成功更新 {numAlerts} 个{numAlerts, plural, =1 {告警} other {告警}}",
"xpack.securitySolution.ruleFromTimeline.error.title": "无法从时间线导入规则",
"xpack.securitySolution.ruleFromTimeline.error.toastMessage": "无法用以下 ID 从时间线创建规则:{id}",
"xpack.securitySolution.ruleGapsOverviewPanel.label": "存在缺口的规则总数:",
"xpack.securitySolution.ruleGapsOverviewPanel.last24HoursLabel": "过去 24 小时",
"xpack.securitySolution.ruleGapsOverviewPanel.last3DaysLabel": "过去 3 天",
"xpack.securitySolution.ruleGapsOverviewPanel.last7DaysLabel": "过去 7 天",
"xpack.securitySolution.ruleGapsOverviewPanel.showRulesWithGapsLabel": "仅限存在缺口的规则",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipContent": "请访问我们的{createEsqlRuleTypeLink}以开始使用 ES|QL 规则。",
"xpack.securitySolution.ruleManagement.esqlQuery.esqlInfoTooltipLink": "文档",
"xpack.securitySolution.ruleManagement.esqlValidation.errorMessage": "验证 ES|QL 时出错:“{message}”",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,27 @@
* 2.0.
*/

/**
* Describes the raw status of individual gap documents regarding to the gap fill process.
*/
export const gapStatus = {
UNFILLED: 'unfilled',
FILLED: 'filled',
PARTIALLY_FILLED: 'partially_filled',
} as const;

export type GapStatus = (typeof gapStatus)[keyof typeof gapStatus];

/**
* Represents the status of a gap fill process for a rule.
* This is a derived, per-rule aggregation that summarizes how well
* the set of gaps for a rule has been filled. It is calculated from the gap
* duration sums with precedence: unfilled > in_progress > filled.
*/
export const gapFillStatus = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: It'd be nice to have comments describing the meaning of gapStatus and gapFillStatus with links to gap definition and extra details.

UNFILLED: 'unfilled',
IN_PROGRESS: 'in_progress',
FILLED: 'filled',
} as const;

export type GapFillStatus = (typeof gapFillStatus)[keyof typeof gapFillStatus];
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export {
MAX_SCHEDULE_BACKFILL_LOOKBACK_WINDOW_MS,
} from './backfill';
export { PLUGIN } from './plugin';
export { gapStatus } from './gap_status';
export type { GapStatus } from './gap_status';
export { gapStatus, gapFillStatus } from './gap_status';
export type { GapStatus, GapFillStatus } from './gap_status';
export { alertDeleteCategoryIds } from './alert_delete';
export type { BackfillInitiator } from './backfill';
export { backfillInitiator } from './backfill';
Expand Down
3 changes: 2 additions & 1 deletion x-pack/platform/plugins/shared/alerting/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ export {
preconfiguredConnectorActionRefPrefix,
systemConnectorActionRefPrefix,
} from './action_ref_prefix';
export { gapStatus } from './constants';
export { gapStatus, gapFillStatus } from './constants';
export type { GapStatus, GapFillStatus } from './constants';

export {
mappingFromFieldMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const getGapsSummaryByRuleIdsResponseSchema = schema.object({
total_unfilled_duration_ms: schema.number(),
total_in_progress_duration_ms: schema.number(),
total_filled_duration_ms: schema.number(),
gap_fill_status: schema.maybe(schema.string()),
})
),
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,34 @@
* 2.0.
*/
import { schema } from '@kbn/config-schema';
import { gapFillStatus, gapStatus } from '../../../../../constants';

export const getRuleIdsWithGapBodySchema = schema.object(
{
end: schema.string(),
start: schema.string(),
statuses: schema.maybe(schema.arrayOf(schema.string())),
// Filters the underlying gap documents before aggregation. Matches the raw
// per-gap statuses.
statuses: schema.maybe(
schema.arrayOf(
schema.oneOf([
schema.literal(gapStatus.UNFILLED),
schema.literal(gapStatus.PARTIALLY_FILLED),
schema.literal(gapStatus.FILLED),
])
)
),
// Filters by the derived, per-rule status that is calculated from gap
// duration sums (unfilled > in_progress > filled precedence).
highest_priority_gap_fill_statuses: schema.maybe(
schema.arrayOf(
schema.oneOf([
schema.literal(gapFillStatus.UNFILLED),
schema.literal(gapFillStatus.IN_PROGRESS),
schema.literal(gapFillStatus.FILLED),
])
)
),
has_unfilled_intervals: schema.maybe(schema.boolean()),
has_in_progress_intervals: schema.maybe(schema.boolean()),
has_filled_intervals: schema.maybe(schema.boolean()),
Expand Down
Loading