[Fleet] add leading dot to hidden indices (#86277)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: John Schulz <github.com@jfsiii.org>
This commit is contained in:
parent
4c3c2ac156
commit
5e5a410204
|
@ -24,7 +24,16 @@ export async function generateOutputApiKey(
|
|||
cluster: ['monitor'],
|
||||
index: [
|
||||
{
|
||||
names: ['logs-*', 'metrics-*', 'traces-*', '.ds-logs-*', '.ds-metrics-*', '.ds-traces-*'],
|
||||
names: [
|
||||
'logs-*',
|
||||
'metrics-*',
|
||||
'traces-*',
|
||||
'.ds-logs-*',
|
||||
'.ds-metrics-*',
|
||||
'.ds-traces-*',
|
||||
'.logs-endpoint.diagnostic.collection-*',
|
||||
'.ds-.logs-endpoint.diagnostic.collection-*',
|
||||
],
|
||||
privileges: ['write', 'create_index', 'indices:admin/auto_create'],
|
||||
},
|
||||
],
|
||||
|
|
|
@ -20,3 +20,18 @@ test('getBaseName', () => {
|
|||
const name = getRegistryDataStreamAssetBaseName(dataStream);
|
||||
expect(name).toStrictEqual('logs-nginx.access');
|
||||
});
|
||||
|
||||
test('getBaseName for hidden index', () => {
|
||||
const dataStream: RegistryDataStream = {
|
||||
dataset: 'nginx.access',
|
||||
title: 'Nginx Acess Logs',
|
||||
release: 'beta',
|
||||
type: 'logs',
|
||||
ingest_pipeline: 'default',
|
||||
package: 'nginx',
|
||||
path: 'access',
|
||||
hidden: true,
|
||||
};
|
||||
const name = getRegistryDataStreamAssetBaseName(dataStream);
|
||||
expect(name).toStrictEqual('.logs-nginx.access');
|
||||
});
|
||||
|
|
|
@ -11,5 +11,6 @@ import { RegistryDataStream } from '../../../types';
|
|||
* {type}-{dataset}
|
||||
*/
|
||||
export function getRegistryDataStreamAssetBaseName(dataStream: RegistryDataStream): string {
|
||||
return `${dataStream.type}-${dataStream.dataset}`;
|
||||
const baseName = `${dataStream.type}-${dataStream.dataset}`;
|
||||
return dataStream.hidden ? `.${baseName}` : baseName;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,16 @@ export async function setupFleet(
|
|||
cluster: ['monitor', 'manage_api_key'],
|
||||
indices: [
|
||||
{
|
||||
names: ['logs-*', 'metrics-*', 'traces-*', '.ds-logs-*', '.ds-metrics-*', '.ds-traces-*'],
|
||||
names: [
|
||||
'logs-*',
|
||||
'metrics-*',
|
||||
'traces-*',
|
||||
'.ds-logs-*',
|
||||
'.ds-metrics-*',
|
||||
'.ds-traces-*',
|
||||
'.logs-endpoint.diagnostic.collection-*',
|
||||
'.ds-.logs-endpoint.diagnostic.collection-*',
|
||||
],
|
||||
privileges: ['write', 'create_index', 'indices:admin/auto_create'],
|
||||
},
|
||||
],
|
||||
|
|
|
@ -66,6 +66,8 @@ export default function (providerContext: FtrProviderContext) {
|
|||
'.ds-logs-*',
|
||||
'.ds-metrics-*',
|
||||
'.ds-traces-*',
|
||||
'.logs-endpoint.diagnostic.collection-*',
|
||||
'.ds-.logs-endpoint.diagnostic.collection-*',
|
||||
],
|
||||
privileges: ['write', 'create_index', 'indices:admin/auto_create'],
|
||||
allow_restricted_indices: false,
|
||||
|
|
Loading…
Reference in a new issue