Skip to content

Commit

Permalink
[Security Solution][Detection Engine] refactpring
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliidm committed Dec 3, 2024
1 parent d501ae3 commit 58334d8
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@ export const getNonMigratedSignalsInfo = async ({
[]
);

if (outdatedIndices.length === 0) {
return {
isMigrationRequired: false,
spaces: [],
indices: [],
};
}

const outdatedIndexNames = outdatedIndices.map((outdatedIndex) => outdatedIndex.indexName);

// remove duplicated spaces
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/security_solution/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ export class Plugin implements ISecuritySolutionPlugin {
all: allRiskScoreIndexPattern,
latest: latestRiskScoreIndexPattern,
},
legacySignalsIndex: config.signalsIndex,
});

this.telemetryUsageCounter = plugins.usageCollection?.createUsageCounter(APP_ID);
Expand Down
7 changes: 4 additions & 3 deletions x-pack/plugins/security_solution/server/usage/collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3078,16 +3078,17 @@ export const registerCollector: RegisterCollector = ({
},
},
legacy_siem_signals: {
indices_total: {
non_migrated_indices_total: {
type: 'long',
_meta: {
description: 'Total number of legacy siem signals indices',
description: 'Total number of non migrated legacy siem signals indices',
},
},
spaces_total: {
type: 'long',
_meta: {
description: 'Total number of Kibana spaces that have legacy siem signals indices',
description:
'Total number of Kibana spaces that have non migrated legacy siem signals indices',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
import type { LegacySiemSignals } from './types';

export const getInitialLegacySiemSignalsUsage = (): LegacySiemSignals => ({
indices_total: 0,
non_migrated_indices_total: 0,
spaces_total: 0,
});
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const getLegacySiemSignalsUsage = async ({
});

return {
indices_total: indices.length,
non_migrated_indices_total: indices.length,
spaces_total: spaces.length,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* 2.0.
*/
export interface LegacySiemSignals {
indices_total: number;
non_migrated_indices_total: number;
spaces_total: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19539,16 +19539,16 @@
},
"legacy_siem_signals": {
"properties": {
"indices_total": {
"non_migrated_indices_total": {
"type": "long",
"_meta": {
"description": "Total number of legacy siem signals indices"
"description": "Total number of non migrated legacy siem signals indices"
}
},
"spaces_total": {
"type": "long",
"_meta": {
"description": "Total number of Kibana spaces that have legacy siem signals indices"
"description": "Total number of Kibana spaces that have non migrated legacy siem signals indices"
}
}
}
Expand Down

0 comments on commit 58334d8

Please sign in to comment.