// 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: "logs-my_app-settings",
  template: {
    settings: {
      "index.default_pipeline": "logs-my_app-default",
      "index.lifecycle.name": "logs",
    },
  },
});
console.log(response);

const response1 = await client.indices.putIndexTemplate({
  name: "logs-my_app-template",
  index_patterns: ["logs-my_app-*"],
  data_stream: {},
  priority: 500,
  composed_of: ["logs-my_app-settings", "logs-my_app-mappings"],
});
console.log(response1);
----
