# Syntactic error on logstash config

**URL:** <https://discuss.elastic.co/t/syntactic-error-on-logstash-config/91466>\
**Category:** Logstash\
**Created:** [June 30, 2017, 4:13pm UTC](https://discuss.elastic.co/t/syntactic-error-on-logstash-config/91466 "2017-06-30T16:13:28Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 30, 2017, 4:46pm UTC](https://discuss.elastic.co/t/syntactic-error-on-logstash-config/91466/2 "2017-06-30T16:46:12Z")

</div>

You can not have conditionals within the elasticsearch output config. Instead use conditionals in the filter block to set index prefix and type in the metadata and then refer to this in the elasticsearch output.

---

_[View the full topic](https://discuss.elastic.co/t/syntactic-error-on-logstash-config/91466)._
