[elasticsearch] patch mappings that are missing types (#12783)

* [elasticsearch] patch mappings that are missing types

* [elasticsearch/healthCheck] fix tests

* fix doc typo

* [tests/functional/dashboard] fix suite name

* [es/healthCheck/ensureTypesExist] limit randomness a bit

* [test/functional] update es archives with complete mappings
This commit is contained in:
Spencer 2017-07-12 16:15:59 -07:00 committed by GitHub
parent 8d1bbd92a6
commit 929aa8efae
11 changed files with 1504 additions and 259 deletions

View file

@ -0,0 +1,247 @@
import expect from 'expect.js';
import sinon from 'sinon';
import { cloneDeep } from 'lodash';
import Chance from 'chance';
import { ensureTypesExist } from '../ensure_types_exist';
const chance = new Chance();
function createRandomTypes(n = chance.integer({ min: 10, max: 20 })) {
return chance.n(
() => ({
name: chance.word(),
mapping: {
type: chance.pickone(['keyword', 'text', 'integer', 'boolean'])
}
}),
n
);
}
function typesToMapping(types) {
return types.reduce((acc, type) => ({
...acc,
[type.name]: type.mapping
}), {});
}
function createV5Index(name, types) {
return {
[name]: {
mappings: typesToMapping(types)
}
};
}
function createV6Index(name, types) {
return {
[name]: {
mappings: {
doc: {
properties: typesToMapping(types)
}
}
}
};
}
function createCallCluster(index) {
return sinon.spy(async (method, params) => {
switch (method) {
case 'indices.get':
expect(params).to.have.property('index', Object.keys(index)[0]);
return cloneDeep(index);
case 'indices.putMapping':
return { ok: true };
default:
throw new Error(`stub not expecting callCluster('${method}')`);
}
});
}
describe('es/healthCheck/ensureTypesExist()', () => {
describe('general', () => {
it('reads the _mappings feature of the indexName', async () => {
const indexName = chance.word();
const callCluster = createCallCluster(createV5Index(indexName, []));
await ensureTypesExist({
callCluster,
indexName,
types: [],
log: sinon.stub()
});
sinon.assert.calledOnce(callCluster);
sinon.assert.calledWith(callCluster, 'indices.get', sinon.match({
feature: '_mappings'
}));
});
});
describe('v5 index', () => {
it('does nothing if mappings match elasticsearch', async () => {
const types = createRandomTypes();
const indexName = chance.word();
const callCluster = createCallCluster(createV5Index(indexName, types));
await ensureTypesExist({
indexName,
callCluster,
types,
log: sinon.stub()
});
sinon.assert.calledOnce(callCluster);
sinon.assert.calledWith(callCluster, 'indices.get', sinon.match({ index: indexName }));
});
it('adds types that are not in index', async () => {
const indexTypes = createRandomTypes();
const missingTypes = indexTypes.splice(-5);
const indexName = chance.word();
const callCluster = createCallCluster(createV5Index(indexName, indexTypes));
await ensureTypesExist({
indexName,
callCluster,
types: [
...indexTypes,
...missingTypes,
],
log: sinon.stub()
});
sinon.assert.callCount(callCluster, 1 + missingTypes.length);
sinon.assert.calledWith(callCluster, 'indices.get', sinon.match({ index: indexName }));
missingTypes.forEach(type => {
sinon.assert.calledWith(callCluster, 'indices.putMapping', sinon.match({
index: indexName,
type: type.name,
body: type.mapping
}));
});
});
it('ignores extra types in index', async () => {
const indexTypes = createRandomTypes();
const missingTypes = indexTypes.splice(-5);
const indexName = chance.word();
const callCluster = createCallCluster(createV5Index(indexName, indexTypes));
await ensureTypesExist({
indexName,
callCluster,
types: missingTypes,
log: sinon.stub()
});
sinon.assert.callCount(callCluster, 1 + missingTypes.length);
sinon.assert.calledWith(callCluster, 'indices.get', sinon.match({ index: indexName }));
missingTypes.forEach(type => {
sinon.assert.calledWith(callCluster, 'indices.putMapping', sinon.match({
index: indexName,
type: type.name,
body: type.mapping
}));
});
});
});
describe('v6 index', () => {
it('does nothing if mappings match elasticsearch', async () => {
const types = createRandomTypes();
const indexName = chance.word();
const callCluster = createCallCluster(createV6Index(indexName, types));
await ensureTypesExist({
indexName,
callCluster,
types,
log: sinon.stub()
});
sinon.assert.calledOnce(callCluster);
sinon.assert.calledWith(callCluster, 'indices.get', sinon.match({ index: indexName }));
});
it('adds types that are not in index', async () => {
const indexTypes = createRandomTypes();
const missingTypes = indexTypes.splice(-5);
const indexName = chance.word();
const callCluster = createCallCluster(createV6Index(indexName, indexTypes));
await ensureTypesExist({
indexName,
callCluster,
types: [
...indexTypes,
...missingTypes,
],
log: sinon.stub()
});
sinon.assert.callCount(callCluster, 1 + missingTypes.length);
sinon.assert.calledWith(callCluster, 'indices.get', sinon.match({ index: indexName }));
missingTypes.forEach(type => {
sinon.assert.calledWith(callCluster, 'indices.putMapping', sinon.match({
index: indexName,
type: 'doc',
body: {
properties: {
[type.name]: type.mapping,
}
}
}));
});
});
it('ignores extra types in index', async () => {
const indexTypes = createRandomTypes();
const missingTypes = indexTypes.splice(-5);
const indexName = chance.word();
const callCluster = createCallCluster(createV6Index(indexName, indexTypes));
await ensureTypesExist({
indexName,
callCluster,
types: missingTypes,
log: sinon.stub()
});
sinon.assert.callCount(callCluster, 1 + missingTypes.length);
sinon.assert.calledWith(callCluster, 'indices.get', sinon.match({ index: indexName }));
missingTypes.forEach(type => {
sinon.assert.calledWith(callCluster, 'indices.putMapping', sinon.match({
index: indexName,
type: 'doc',
body: {
properties: {
[type.name]: type.mapping,
}
}
}));
});
});
it('does not define the _default_ type', async () => {
const indexTypes = [];
const missingTypes = [
{
name: '_default_',
mapping: {}
}
];
const indexName = chance.word();
const callCluster = createCallCluster(createV6Index(indexName, indexTypes));
await ensureTypesExist({
indexName,
callCluster,
types: missingTypes,
log: sinon.stub()
});
sinon.assert.calledOnce(callCluster);
sinon.assert.calledWith(callCluster, 'indices.get', sinon.match({ index: indexName }));
});
});
});

View file

@ -11,6 +11,7 @@ import kibanaVersion from '../kibana_version';
import { esTestServerUrlParts } from '../../../../../test/es_test_server_url_parts';
import * as determineEnabledScriptingLangsNS from '../determine_enabled_scripting_langs';
import { determineEnabledScriptingLangs } from '../determine_enabled_scripting_langs';
import * as ensureTypesExistNS from '../ensure_types_exist';
const esPort = esTestServerUrlParts.port;
const esUrl = url.format(esTestServerUrlParts);
@ -29,6 +30,7 @@ describe('plugins/elasticsearch', () => {
// Stub the Kibana version instead of drawing from package.json.
sinon.stub(kibanaVersion, 'get').returns(COMPATIBLE_VERSION_NUMBER);
sinon.stub(ensureTypesExistNS, 'ensureTypesExist');
// setup the plugin stub
plugin = {
@ -85,6 +87,7 @@ describe('plugins/elasticsearch', () => {
afterEach(() => {
kibanaVersion.get.restore();
determineEnabledScriptingLangs.restore();
ensureTypesExistNS.ensureTypesExist.restore();
});
it('should set the cluster green if everything is ready', function () {

View file

@ -0,0 +1,68 @@
/**
* Checks that a kibana index has all of the types specified. Any type
* that is not defined in the existing index will be added via the
* `indicies.putMapping` API.
*
* @param {Object} options
* @property {Function} options.log a method for writing log messages
* @property {string} options.indexName name of the index in elasticsearch
* @property {Function} options.callCluster a function for executing client requests
* @property {Array<Object>} options.types an array of objects with `name` and `mapping` properties
* describing the types that should be in the index
* @return {Promise<undefined>}
*/
export async function ensureTypesExist({ log, indexName, callCluster, types }) {
const index = await callCluster('indices.get', {
index: indexName,
feature: '_mappings'
});
// could be different if aliases were resolved by `indices.get`
const resolvedName = Object.keys(index)[0];
const mappings = index[resolvedName].mappings;
const literalTypes = Object.keys(mappings);
const v6Index = literalTypes.length === 1 && literalTypes[0] === 'doc';
// our types aren't really es types, at least not in v6
const typesDefined = Object.keys(
v6Index
? mappings.doc.properties
: mappings
);
for (const type of types) {
if (v6Index && type.name === '_default_') {
// v6 indices don't get _default_ types
continue;
}
const defined = typesDefined.includes(type.name);
if (defined) {
continue;
}
log(['info', 'elasticsearch'], {
tmpl: `Adding mappings to kibana index for SavedObject type "<%= typeName %>"`,
typeName: type.name,
typeMapping: type.mapping
});
if (v6Index) {
await callCluster('indices.putMapping', {
index: indexName,
type: 'doc',
body: {
properties: {
[type.name]: type.mapping
}
}
});
} else {
await callCluster('indices.putMapping', {
index: indexName,
type: type.name,
body: type.mapping
});
}
}
}

View file

@ -8,6 +8,7 @@ import { ensureEsVersion } from './ensure_es_version';
import { ensureNotTribe } from './ensure_not_tribe';
import { ensureAllowExplicitIndex } from './ensure_allow_explicit_index';
import { determineEnabledScriptingLangs } from './determine_enabled_scripting_langs';
import { ensureTypesExist } from './ensure_types_exist';
const NoConnections = elasticsearch.errors.NoConnections;
import util from 'util';
@ -101,6 +102,12 @@ module.exports = function (plugin, server, { mappings }) {
.then(() => ensureNotTribe(callAdminAsKibanaUser))
.then(() => ensureAllowExplicitIndex(callAdminAsKibanaUser, config))
.then(waitForShards)
.then(() => ensureTypesExist({
callCluster: callAdminAsKibanaUser,
log: (...args) => server.log(...args),
indexName: config.get('kibana.index'),
types: Object.keys(mappings).map(name => ({ name, mapping: mappings[name] }))
}))
.then(_.partial(migrateConfig, server, { mappings }))
.then(async () => {
results.enabledScriptingLangs = await determineEnabledScriptingLangs(callDataAsKibanaUser);

View file

@ -4,7 +4,7 @@ export default function ({ getService, getPageObjects }) {
const retry = getService('retry');
const PageObjects = getPageObjects(['dashboard', 'header', 'common']);
describe('dashboard save', function describeIndexTests() {
describe('dashboard clone', function describeIndexTests() {
const dashboardName = 'Dashboard Clone Test';
const clonedDashboardName = dashboardName + ' Copy';

View file

@ -4,78 +4,128 @@
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "5",
"number_of_shards": "1",
"mapper": {
"dynamic": "false"
},
"number_of_replicas": "1"
}
},
"mappings": {
"config": {
"index-pattern": {
"dynamic": "strict",
"properties": {
"buildNum": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"visualization": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
},
"uiStateJSON": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
"type": "text"
}
}
},
"_default_": {
"dynamic": "strict"
},
"server": {
"dynamic": "strict",
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"timelion-sheet": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"search": {
"dynamic": "strict",
"properties": {
"columns": {
"type": "text"
"type": "keyword"
},
"description": {
"type": "text"
@ -91,7 +141,7 @@
}
},
"sort": {
"type": "text"
"type": "keyword"
},
"title": {
"type": "text"
@ -101,54 +151,16 @@
}
}
},
"index-pattern": {
"config": {
"dynamic": "true",
"properties": {
"fields": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"sourceFilters": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"timeFieldName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"server": {
"properties": {
"uuid": {
"buildNum": {
"type": "keyword"
}
}
},
"dashboard": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
@ -169,14 +181,30 @@
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "text"
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "text"
"type": "keyword"
},
"title": {
"type": "text"
@ -188,6 +216,29 @@
"type": "integer"
}
}
},
"url": {
"dynamic": "strict",
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
}
}
}

View file

@ -4,107 +4,239 @@
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "5",
"number_of_shards": "1",
"mapper": {
"dynamic": "false"
},
"number_of_replicas": "1"
}
},
"mappings": {
"search": {
"dynamic": "strict",
"properties": {
"columns": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "keyword"
},
"description": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
},
"hits": {
"type": "long"
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
}
}
},
"sort": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"visualization": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
},
"_default_": {
"dynamic": "strict"
},
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
}
}
},
"timelion-sheet": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"dynamic": "strict",
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"dashboard": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"url": {
"dynamic": "strict",
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
"ignore_above": 2048
}
}
},
"version": {
"type": "long"
}
}
},
"index-pattern": {
"dynamic": "strict",
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
},
"timeFieldName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "keyword"
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
}
}
}

View file

@ -5,11 +5,23 @@
"settings": {
"index": {
"number_of_shards": "1",
"mapper": {
"dynamic": "false"
},
"number_of_replicas": "1"
}
},
"mappings": {
"server": {
"dynamic": "strict",
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
@ -24,6 +36,218 @@
}
}
}
},
"url": {
"dynamic": "strict",
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"search": {
"dynamic": "strict",
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"_default_": {
"dynamic": "strict"
},
"index-pattern": {
"dynamic": "strict",
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"visualization": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
},
"dashboard": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"timelion-sheet": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
}
}
}

View file

@ -4,102 +4,237 @@
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "5",
"number_of_shards": "1",
"mapper": {
"dynamic": "false"
},
"number_of_replicas": "1"
}
},
"mappings": {
"index-pattern": {
"properties": {
"fields": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"sourceFilters": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"timeFieldName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"visualization": {
"dashboard": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"visualization": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
},
"index-pattern": {
"dynamic": "strict",
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"_default_": {
"dynamic": "strict"
},
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
}
}
},
"server": {
"dynamic": "strict",
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"search": {
"dynamic": "strict",
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"timelion-sheet": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"url": {
"dynamic": "strict",
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
"ignore_above": 2048
}
}
}

View file

@ -4,48 +4,239 @@
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "5",
"number_of_shards": "1",
"mapper": {
"dynamic": "false"
},
"number_of_replicas": "1"
}
},
"mappings": {
"index-pattern": {
"url": {
"dynamic": "strict",
"properties": {
"fields": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
"ignore_above": 2048
}
}
}
}
},
"index-pattern": {
"dynamic": "strict",
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"type": "text"
},
"timeFieldName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
}
}
},
"timelion-sheet": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"visualization": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
},
"search": {
"dynamic": "strict",
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"_default_": {
"dynamic": "strict"
},
"server": {
"dynamic": "strict",
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"dashboard": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
}

View file

@ -5,12 +5,105 @@
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "0"
"mapper": {
"dynamic": "false"
},
"number_of_replicas": "1"
}
},
"mappings": {
"config": {
"visualization": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
},
"search": {
"dynamic": "strict",
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"index-pattern": {
"dynamic": "strict",
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
},
"dateFormat:tz": {
"type": "text",
"fields": {
@ -31,45 +124,139 @@
}
}
},
"index-pattern": {
"server": {
"dynamic": "strict",
"properties": {
"fields": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
"uuid": {
"type": "keyword"
}
}
},
"_default_": {
"dynamic": "strict"
},
"dashboard": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sourceFilters": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFieldName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"url": {
"dynamic": "strict",
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
"ignore_above": 2048
}
}
}
}
},
"timelion-sheet": {
"dynamic": "strict",
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
}
}
}