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


#1

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" 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


(Ondro Tadanai) #2

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 ']'


#3

Got this error

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


(Lars van der Spek) #4

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


#5

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"] } }


(Magnus B├Ąck) #6

Logstash config files require accurate indentation.

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


(system) #7

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