Skip to content

[event log] query should be over all version indices, not just the current version indices #81274

@pmuellr

Description

@pmuellr

In the code below, we are querying the event log using the alias we create to write event docs to the indices:

return await this.esContext.esAdapter.queryEventsBySavedObject(
this.esContext.esNames.alias,
namespace,
type,
id,
findOptions
);

That alias name - and other es-related names - are generated here:

export function getEsNames(baseName: string): EsNames {
const eventLogName = `${baseName}${EVENT_LOG_NAME_SUFFIX}`;
const eventLogNameWithVersion = `${eventLogName}${EVENT_LOG_VERSION_SUFFIX}`;
const eventLogPolicyName = `${
baseName.startsWith('.') ? baseName.substring(1) : baseName
}${EVENT_LOG_NAME_SUFFIX}-policy`;
return {
base: baseName,
alias: eventLogNameWithVersion,
ilmPolicy: `${eventLogPolicyName}`,
indexPattern: `${eventLogName}-*`,
indexPatternWithVersion: `${eventLogNameWithVersion}-*`,
initialIndex: `${eventLogNameWithVersion}-000001`,
indexTemplate: `${eventLogNameWithVersion}-template`,
};
}

For v7.10.0, the alias name will be .kibana-event-log-7.10.0. This will limit searches to only the events generated by the current version of Kibana. We should be able to search older versions as well - the mappings have not changed significantly since the beginnings. Clearly we need some thoughts about the future where the mappings could change in incompatible ways, and consider what happens when the event log becomes a datastream.

For now, it seems like we should use EsNames.indexPattern, which would be set to the string .kibana-event-log-*, for these queries.

Metadata

Metadata

Assignees

Labels

Feature:EventLogTeam:ResponseOpsPlatform ResponseOps team (formerly the Cases and Alerting teams) t//bugFixes for quality problems that affect the customer experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions