Query template not found by Logstash

Hello,
I am using a .conf file which uses the elasticsearch filter to query an index and enrich the documents coming in. I am using a query template called search_by_title.json which is stored in the same directory as the .conf file.

    elasticsearch {
            hosts => ["localhost:9200"]
            index => "feeds"
            query_template => "${PATH_TO_DIR}/search_by_title.json"
            fields => { 
                    "type" => "type"
                }
        }

Additionally I have other pipelines running, so I added them to the pipelines.yml file in my logstash directory as shown below:

    - pipeline.id: pipeline_1
      path.config: "${PATH_TO_DIR}/conf1.conf"
    - pipeline.id: pipeline_2
      path.config: "${PATH_TO_DIR}/conf2.conf"

Logstash doesn't seem to find the search_by_title.json file which is used by the conf2.conf file and shows the following message:

Pipeline aborted due to error {:pipeline_id=>"pipeline_4", :exception=>#<Errno::ENOENT: No such file or directory - search_by_title.json>

I tried adding the full path and copying the file to the same logstash directory to no avail.
Would greatly appreciate it if anybody has some insights that could help me.

Thanks!