# Error: Expected one of #, ", ', }

**URL:** <https://discuss.elastic.co/t/error-expected-one-of/103504>\
**Category:** Logstash\
**Created:** [October 11, 2017, 8:28am UTC](https://discuss.elastic.co/t/error-expected-one-of/103504 "2017-10-11T08:28:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navinder](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Navinder](https://discuss.elastic.co/u/Navinder)\
**Post date:** [October 11, 2017, 8:28am UTC](https://discuss.elastic.co/t/error-expected-one-of/103504/1 "2017-10-11T08:28:34Z")

</div>

Hi all, I am facing a problem with logstash.

Here's the config file -

input {  
file { path =\> "/home/app/estest.csv" start\_position =\> "beginning" } }  
filter {  
}  
output {  
elasticsearch { hosts =\> "[http://myownhost:9200](http://myownhost:9200)" index =\> "revenue" document\_type =\> "customer" } }

It's giving the error below -

Error: Expected one of #, ", ', } at line 6, column 18 (byte 132) after output {  
elasticsearch {

hexdump -C also didn't give any clue.

I am not able to pin point any error here. Please help. Thanks

---

<div class="post-metadata">

**Author:** ![Ondro\_Tadanai](https://avatars.discourse-cdn.com/v4/letter/o/ce7236/32.png) [@Ondro\_Tadanai](https://discuss.elastic.co/u/Ondro_Tadanai)\
**Post date:** [October 11, 2017, 8:47am UTC](https://discuss.elastic.co/t/error-expected-one-of/103504/2 "2017-10-11T08:47:19Z")

</div>

Hi,  
try this configuration

input  
{  
file  
{  
path =\> "/home/app/estest.csv"  
start\_position =\> "beginning"  
}  
}  
filter  
{  
}  
output  
{  
elasticsearch  
{  
hosts =\> ["myownhost:9200"]  
index =\> "revenue"  
document\_type =\> "customer"  
}  
}

notice hosts value between '[' and ']'

---

<div class="post-metadata">

**Author:** ![Navinder](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Navinder](https://discuss.elastic.co/u/Navinder)\
**Post date:** [October 11, 2017, 8:58am UTC](https://discuss.elastic.co/t/error-expected-one-of/103504/3 "2017-10-11T08:58:02Z")

</div>

Got this error

Error: Expected one of #, ", ', } at line 6, column 18 (byte 170) after output {  
elasticsearch {

---

<div class="post-metadata">

**Author:** ![lars.vanderspek](https://avatars.discourse-cdn.com/v4/letter/l/e9a140/32.png) [@lars.vanderspek](https://discuss.elastic.co/u/lars.vanderspek)\
**Post date:** [October 11, 2017, 11:13am UTC](https://discuss.elastic.co/t/error-expected-one-of/103504/4 "2017-10-11T11:13:07Z")

</div>

Did you check your indentation? Logstash config files require accurate indentation. Make sure to have the appropriate amount of spaces before each line.

---

<div class="post-metadata">

**Author:** ![Navinder](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Navinder](https://discuss.elastic.co/u/Navinder)\
**Post date:** [October 11, 2017, 12:53pm UTC](https://discuss.elastic.co/t/error-expected-one-of/103504/5 "2017-10-11T12:53:09Z")

</div>

Yeah, got it working. Firstly my logstash version was quite lower so it didn't support hosts. And removed some spaces. Here's the working one.

input  
{  
file { path =\> "/home/app/estest.csv" start\_position =\> "beginning" sincedb\_path =\> "/home/app/input.log" } }  
filter  
{  
}  
output  
{  
elasticsearch { index =\> "revenue" hosts =\> ["[http://myownhost:9200](http://myownhost:9200)"] } }

---

<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:** [October 12, 2017, 11:59am UTC](https://discuss.elastic.co/t/error-expected-one-of/103504/6 "2017-10-12T11:59:04Z")

</div>

> Logstash config files require accurate indentation.

The pipeline configuration files we're talking about here don't care about the indentation.

---

<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:** [November 9, 2017, 11:59am UTC](https://discuss.elastic.co/t/error-expected-one-of/103504/7 "2017-11-09T11:59:16Z")

</div>

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