Error: Expected one of #, input, filter, output at line 1, column 1 (byte 1) after {:level=>:error}

Hi all, I have a problem , run logstash and no problem I could see data Kibana but off to logstash and when I run again pulls me this error.

Error: Expected one of #, input, filter, output at line 1, column 1 (byte 1) after {:level=>:error}

Here is the code

  input {
      file {
            path => "/home/rack/bolsa.csv"
            start_position =>"beginning"
            type => "stock"
            sincedb_path => "NUL"
            }
}
  filter {
    csv {
            columns =>["date_of_record","open","high","low","close","volume","adj_close","company","ip"]
            separator => ","
    }

    date {
            match => ["date_of_record", "yyyy-MM-dd"]
            locale => "es-ES"
            target => "@timestamp"
    }

    mutate {
            convert => ["open","float"]
            convert => ["high","float"]
            convert => ["low","float"]
            convert => ["close","float"]
            convert => ["volume","integer"]
            convert => ["adj_close","float"]
            convert => ["company","string"]
    }
}

output{
     elasticsearch {
            index => ["logstash-bolsa-%{+yyyy}"]
            hosts => ["localhost:9200"]
            }
    stdout { codec => rubydebug }
}

I copied and pasted that snippet to a file and it worked fine for me so I suspect you have some unexpected stuff at the beginning of the file, like a byte-order mark. Passing the file through hexdump -C can be useful for checking that.

1 Like

thank you