elastic: devenv: add nested objects to data generator (#55482)

This commit is contained in:
Gábor Farkas
2022-09-21 11:34:49 +02:00
committed by GitHub
parent bad4f7fec5
commit 3a545007ca
+12
View File
@@ -80,6 +80,9 @@ async function elasticSetupIndexTemplate() {
location: {
type: 'geo_point',
},
shapes: {
type: 'nested',
}
},
},
},
@@ -108,6 +111,15 @@ function getRandomLogItem(counter, timestamp) {
level: chooseRandomElement(['info', 'info', 'error']),
// location: chooseRandomElement(LOCATIONS),
location: makeRandomPoint(),
shapes: Math.random() < 0.5 ? [
{"type": "triangle"},
{"type": "square"},
] : [
{"type": "triangle"},
{"type": "triangle"},
{"type": "triangle"},
{"type": "square"},
],
};
}