-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
In the code below, we are querying the event log using the alias we create to write event docs to the indices:
kibana/x-pack/plugins/event_log/server/event_log_client.ts
Lines 94 to 100 in b362ed1
| 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:
kibana/x-pack/plugins/event_log/server/es/names.ts
Lines 22 to 37 in b362ed1
| 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.