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

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?

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.

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

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