Files
elasticsearch-js/docs/doc_examples/1c1f2a6a193d9e64c37242b2824b3031.asciidoc
2024-07-29 17:10:05 -05:00

50 lines
1.0 KiB
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: "source_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);
const response1 = await client.indices.putIndexTemplate({
name: 1,
index_patterns: ["k8s*"],
composed_of: ["source_template"],
data_stream: {},
});
console.log(response1);
----