Error while importing CSV file with Logstash

While it seems like my config file is right, it still doesn't run properly, accusing it of missing a #

I'm executing this command:
logstash -f C:\Users\CONSISTE\Desktop\logstash\dados\teste.config

message=>"Expected one of #, input, filter, output at line 1, column 1 (byte 1) after ",

my config file:

input {
  file {
    path => "C:\Users\CONSISTE\Desktop\tabelas_cont\teste_csv.csv"
    start_position => "beginning"
    sincedb_path => "C:\Users\CONSISTE\Desktop\tabelas_cont\areas.log"
  }
}
filter {
  csv {
      columns => ["id","descricao","id_cli_area","instalacao_id","instancia_id","pagina_id","tipo_id"]
      separator => ","
  }
}
output {
   elasticsearch {
     hosts => "http://localhost:9200"
     index => "areas"
  }
stdout {}
}

I also created a CSV sample, just to check if there was a character coding error, but the same error occurred

Are you using -f to point to that specific file? If not, how are you telling logstash where to finds its configuration.

yes, i'm using that command:

logstash -f C:\Users\CONSISTE\Desktop\logstash\dados\teste.config

OK. logstash does not think that file starts with "input {". Can you run with "--log.level debug" and check the logstash.config.source.local.configpathloader message to make sure it is reading the right file. If it is then there could be a non-printing character at the start of the file. A BOM perhaps?

Fixed it, changed the file to UTF without BOM, also, since I'm using Windows, I had to use "/" and not "" in path and sincedb_path, this way it worked.

Thanks for the help.

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