[6.x] [Infra UI] Patch the log sample dataset to be compatible with default log sources (#30060) (#30184)

Backports the following commits to 6.x:
 - [Infra UI] Patch the log sample dataset to be compatible with default log sources  (#30060)
This commit is contained in:
Felix Stürmer 2019-02-06 11:57:11 +01:00 committed by GitHub
parent 1d1a4f63d9
commit ea8042042f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 5 deletions

View file

@ -134,6 +134,10 @@ export const fieldMappings = {
timestamp: {
type: 'date'
},
'@timestamp': {
type: 'alias',
path: 'timestamp'
},
phpmemory: {
type: 'long'
},
@ -149,4 +153,4 @@ export const fieldMappings = {
}
}
}
};
};

View file

@ -37,7 +37,9 @@ export async function calculateCardinalityOfNodeField(
};
const resp = await search<CardinalityAggregation>({
allow_no_indices: true,
body,
ignore_unavailable: true,
index: `${sourceConfiguration.logAlias},${sourceConfiguration.metricAlias}`,
});

View file

@ -45,6 +45,8 @@ export class InfraElasticsearchSourceStatusAdapter implements InfraSourceStatusA
public async hasIndices(request: InfraFrameworkRequest, indexNames: string) {
return await this.framework
.callWithRequest(request, 'search', {
ignore_unavailable: true,
allow_no_indices: true,
index: indexNames,
size: 0,
terminate_after: 1,

View file

@ -8,7 +8,7 @@ export const defaultSourceConfiguration = {
name: 'Default',
description: '',
metricAlias: 'metricbeat-*',
logAlias: 'filebeat-*',
logAlias: 'filebeat-*,kibana_sample_data_logs*',
fields: {
container: 'docker.container.id',
host: 'host.name',

View file

@ -36,7 +36,7 @@ const sourcesTests: KbnTestProvider = ({ getService }) => {
// shipped default values
expect(sourceConfiguration.name).to.be('Default');
expect(sourceConfiguration.metricAlias).to.be('metricbeat-*');
expect(sourceConfiguration.logAlias).to.be('filebeat-*');
expect(sourceConfiguration.logAlias).to.be('filebeat-*,kibana_sample_data_logs*');
expect(sourceConfiguration.fields.container).to.be('docker.container.id');
expect(sourceConfiguration.fields.host).to.be('host.name');
expect(sourceConfiguration.fields.pod).to.be('kubernetes.pod.uid');
@ -107,7 +107,7 @@ const sourcesTests: KbnTestProvider = ({ getService }) => {
expect(configuration.name).to.be('NAME');
expect(configuration.description).to.be('');
expect(configuration.metricAlias).to.be('metricbeat-*');
expect(configuration.logAlias).to.be('filebeat-*');
expect(configuration.logAlias).to.be('filebeat-*,kibana_sample_data_logs*');
expect(configuration.fields.container).to.be('docker.container.id');
expect(configuration.fields.host).to.be('host.name');
expect(configuration.fields.pod).to.be('kubernetes.pod.uid');
@ -285,7 +285,7 @@ const sourcesTests: KbnTestProvider = ({ getService }) => {
expect(version).to.be.greaterThan(initialVersion);
expect(updatedAt).to.be.greaterThan(createdAt);
expect(configuration.metricAlias).to.be('metricbeat-**');
expect(configuration.logAlias).to.be('filebeat-*');
expect(configuration.logAlias).to.be('filebeat-*,kibana_sample_data_logs*');
expect(status.logIndicesExist).to.be(true);
expect(status.metricIndicesExist).to.be(true);
});