# Where do I put the template file for the elasticsearch filter?

**URL:** <https://discuss.elastic.co/t/where-do-i-put-the-template-file-for-the-elasticsearch-filter/180819>\
**Category:** Logstash\
**Created:** [May 13, 2019, 1:10pm UTC](https://discuss.elastic.co/t/where-do-i-put-the-template-file-for-the-elasticsearch-filter/180819 "2019-05-13T13:10:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdmcalee](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jdmcalee](https://discuss.elastic.co/u/jdmcalee)\
**Post date:** [May 13, 2019, 1:10pm UTC](https://discuss.elastic.co/t/where-do-i-put-the-template-file-for-the-elasticsearch-filter/180819/1 "2019-05-13T13:10:06Z")

</div>

I'm trying to add a new filter to a pipeline with the following config:

```
elasticsearch {
    index => "customers"
    query_template => "ticket-customer-search.json"
    docinfo_fields => { "_id" => "customerId" }
}

```

It works correctly on my workstation, when I run logstash via command line

```
logstash -f test.conf

```

and the ticket-customer-search.json file is in that same directory. When I try to use the config on the production CentOS server, logstash can't find the template file. I get an exception logged.

> Errno::ENOENT: No such file or directory - ticket-customer-search.json

I've tried putting the file in /etc/logstash/pipelines (where the config lives) and in /etc/logstash, and I tried putting the full path in the config. The exception was thrown in all cases. Where should that template file be stored?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 13, 2019, 1:22pm UTC](https://discuss.elastic.co/t/where-do-i-put-the-template-file-for-the-elasticsearch-filter/180819/2 "2019-05-13T13:22:20Z")

</div>

If you use the full path in the configuration it will open that. If you are still getting an error message with the full path verify that logstash was restarted, that it is has read access to the file and at least execute access to each directory in the path.

---

<div class="post-metadata">

**Author:** ![jdmcalee](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jdmcalee](https://discuss.elastic.co/u/jdmcalee)\
**Post date:** [May 13, 2019, 1:47pm UTC](https://discuss.elastic.co/t/where-do-i-put-the-template-file-for-the-elasticsearch-filter/180819/3 "2019-05-13T13:47:35Z")

</div>

I must have failed to restart it after putting the full path in. That is working.

---

<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:** [June 10, 2019, 1:47pm UTC](https://discuss.elastic.co/t/where-do-i-put-the-template-file-for-the-elasticsearch-filter/180819/4 "2019-06-10T13:47:35Z")

</div>

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