# How to list all scripts/templates when GET \_cat/templates doesn't return them

**URL:** <https://discuss.elastic.co/t/how-to-list-all-scripts-templates-when-get-cat-templates-doesnt-return-them/326476>\
**Category:** Kibana\
**Created:** [February 24, 2023, 10:08pm UTC](https://discuss.elastic.co/t/how-to-list-all-scripts-templates-when-get-cat-templates-doesnt-return-them/326476 "2023-02-24T22:08:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cal\_L](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cal_l/32/117744_2.png) [@Cal\_L](https://discuss.elastic.co/u/Cal_L)\
**Post date:** [February 24, 2023, 10:08pm UTC](https://discuss.elastic.co/t/how-to-list-all-scripts-templates-when-get-cat-templates-doesnt-return-them/326476/1 "2023-02-24T22:08:02Z")

</div>

## I am new to ES ... I am looking at the existing codes which my team is using

es.put\_script("my\_custom\_template\_1\_id", my\_custom\_template\_1\_query)

I can retrieve the the template info by using the SPECIFIC template id like this

```auto
POST _render/template
{
  "id": "my_custom_template_1_id",
  "params": {
        "searchterm": "whatever",
    }
}

```

or

```auto
es.get_script(my_custom_template_1_id)

```

But I can't find a way to list the all template IDs. I've tried all the "template" api from kibana, it lists something but not the my\_custom\_template\_1\_id.Here is the output I got when calling GET \_cat/templates

```auto
tenant_template [.kibana_-*_*, .kibana_0*_*, .kibana_1*_*, .kibana_2*_*, .kibana_3*_*, .kibana_4*_*] 0  

```

I don't know whether it is file based index/template or not which I found it is NOT supported ... anyhow, is there any way for me to list all the my\_custom\_template\_1\_id, my\_custom\_template\_2\_id and etc??

ES Version = 7.10

---

<div class="post-metadata">

**Author:** ![canelia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/canelia/32/141857_2.png) [@canelia](https://discuss.elastic.co/u/canelia)\
**Post date:** [February 27, 2023, 3:07am UTC](https://discuss.elastic.co/t/how-to-list-all-scripts-templates-when-get-cat-templates-doesnt-return-them/326476/2 "2023-02-27T03:07:55Z")

</div>

try it.

```auto
GET _cluster/state/metadata?pretty&filter_path=**.stored_scripts

```

---

<div class="post-metadata">

**Author:** ![Cal\_L](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cal_l/32/117744_2.png) [@Cal\_L](https://discuss.elastic.co/u/Cal_L)\
**Post date:** [February 27, 2023, 3:44am UTC](https://discuss.elastic.co/t/how-to-list-all-scripts-templates-when-get-cat-templates-doesnt-return-them/326476/3 "2023-02-27T03:44:16Z")

</div>

Awesome! It works!! Thank you!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 27, 2023, 3:44am UTC](https://discuss.elastic.co/t/how-to-list-all-scripts-templates-when-get-cat-templates-doesnt-return-them/326476/4 "2023-03-27T03:44:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
