42 lines
851 B
Plaintext
42 lines
851 B
Plaintext
// This file is autogenerated, DO NOT EDIT
|
|
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
|
|
|
[source, js]
|
|
----
|
|
const response = await client.cluster.putComponentTemplate({
|
|
name: "destination_template",
|
|
template: {
|
|
settings: {
|
|
index: {
|
|
number_of_replicas: 2,
|
|
number_of_shards: 2,
|
|
mode: "time_series",
|
|
routing_path: ["metricset"],
|
|
},
|
|
},
|
|
mappings: {
|
|
properties: {
|
|
"@timestamp": {
|
|
type: "date",
|
|
},
|
|
metricset: {
|
|
type: "keyword",
|
|
time_series_dimension: true,
|
|
},
|
|
k8s: {
|
|
properties: {
|
|
tx: {
|
|
type: "long",
|
|
},
|
|
rx: {
|
|
type: "long",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
----
|