# Logstash output to elasticsearch - how to include external synonims file?

**URL:** <https://discuss.elastic.co/t/logstash-output-to-elasticsearch-how-to-include-external-synonims-file/123381>\
**Category:** Logstash\
**Created:** [March 10, 2018, 8:44am UTC](https://discuss.elastic.co/t/logstash-output-to-elasticsearch-how-to-include-external-synonims-file/123381 "2018-03-10T08:44:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gennolo](https://avatars.discourse-cdn.com/v4/letter/g/e95f7d/32.png) [@gennolo](https://discuss.elastic.co/u/gennolo)\
**Post date:** [March 10, 2018, 8:44am UTC](https://discuss.elastic.co/t/logstash-output-to-elasticsearch-how-to-include-external-synonims-file/123381/1 "2018-03-10T08:44:29Z")

</div>

I am using Logstash to output a big CSV file inside an ElasticSearch index and I need to include a SOLR synonims external file ([https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-tokenfilter.html)) into account when indexing.

I see that when the index is done directly from ElasticSeaarch Indices API , this operation can be done by specifying the synonim file path in the index configuration JSON, something like :

```
"custom_synonym": {
"type": "synonym",
"synonyms_path": "analysis/synonyms.txt"
}

```

But I can't find anywhere how can I include the same file from the logstash config file when indexing from Logstash

I searched in official documentation, but I can't find any useful hint :

[https://www.elastic.co/guide/en/logstash/5.3/plugins-outputs-elasticsearch.html](https://www.elastic.co/guide/en/logstash/5.3/plugins-outputs-elasticsearch.html)

Any idea on how to achieve this ?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 13, 2018, 9:22pm UTC](https://discuss.elastic.co/t/logstash-output-to-elasticsearch-how-to-include-external-synonims-file/123381/2 "2018-03-13T21:22:32Z")

</div>

The file can't be supplied via the REST API (i.e. Logstash can't supply it). It must reside on the Elasticsearch server's file system.

---

<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:** [April 10, 2018, 9:22pm UTC](https://discuss.elastic.co/t/logstash-output-to-elasticsearch-how-to-include-external-synonims-file/123381/3 "2018-04-10T21:22:54Z")

</div>

Closed on April 10, 2018, 9:22pm UTC

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