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

45 lines
921 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.indices.putIndexTemplate({
name: "sensor-template",
index_patterns: ["sensor-*"],
data_stream: {},
template: {
lifecycle: {
downsampling: [
{
after: "1d",
fixed_interval: "1h",
},
],
},
settings: {
"index.mode": "time_series",
},
mappings: {
properties: {
node: {
type: "keyword",
time_series_dimension: true,
},
temperature: {
type: "half_float",
time_series_metric: "gauge",
},
voltage: {
type: "half_float",
time_series_metric: "gauge",
},
"@timestamp": {
type: "date",
},
},
},
},
});
console.log(response);
----