Won't load a config file

I can't get my fantasy_hockey.config file to load into ElasticSearch (version 6.1.1). Here is my config file followed by my launch statement followed by the error output. According to the error output message I'm missing a "#" or a {"; I don't see why I would need either one. Please advise. Thank you in advance.

#     Filename:  fantasy_hockey.conf
#     Version:  1.0
#     Author:  Ted W. Stapenhorst
#     Date:  11th January '18
#     Description:  This Logstash configuration file will be used to read in 
#     fantasy hockey weekly statistics.
input {
  file {
    path => "/Users/tstapenhorst/elastic/logstash-6.1.1/data/HockeyWeek1.csv"
    start_position => "beginning"
    ignore_older => 0
filter {
    csv {
      separator => ","
#  Team Number (TNBR),Team Owner (TO),Team Name (TN),Division (DV) ,Season (S),
#  Week Number (WN),Week Ending Date (WED),Opponent (OPP),Total Points (TP),
#  Games Played (GP),Goals (G),Assists (A),Power Play Goals (PPG),Power Play Points (PPP),
#  Short Handed Goals (SHG),Hits (HIT),Blocks (BLK),Goalie Starts (GS),Wins (W),
#  Loses (L),Goals Allowed (GA),Saves (SV),Shut Outs (SO)
    #  Get rid of the Header Record
    if [TNBR] == "TNBR"
      drop {}
output {
   elasticsearch {
     hosts => "http://localhost:9200"
     index => "fantasy_hockey"
stdout {}

**Here is my launch statement:**

./bin/logstash -f ~/elastic/logstash-6.1.1/config/fantasy_hockey.conf --config.test_and_exit

**Here is the error message:**

Sending Logstash's logs to /Users/tstapenhorst/elastic/logstash-6.1.1/logs which is now configured via log4j2.properties
[2018-01-13T14:43:53,496][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/Users/tstapenhorst/elastic/logstash-6.1.1/modules/fb_apache/configuration"}
[2018-01-13T14:43:53,519][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/Users/tstapenhorst/elastic/logstash-6.1.1/modules/netflow/configuration"}
[2018-01-13T14:43:53,849][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2018-01-13T14:43:54,870][FATAL][logstash.runner          ] 
The given configuration is invalid. Reason: Expected one of #, { at line 21, 
column 36 (byte 893) after filter {
    csv {
        separator => ","
        #  Team Number (TNBR),Team Owner (TO),Team Name (TN),Division (DV) ,Season (S),Week Number (WN),Week Ending Date (WED),
        #  Opponent (OPP),Total Points (TP),Games Played (GP),Goals (G),Assists (A),Power Play Goals (PPG),Power Play Points (PPP),
        #  Short Handed Goals (SHG),Hits (HIT),Blocks (BLK),Goalie Starts (GS),Wins (W),Loses (L),Goals Allowed (GA),Saves (SV),Shut Outs (SO)

        columns => [TNBR,TO,TN,DV,S

Please edit your post and use the </> button, or markdown style code tagging, to make your config more readable. It's really hard to read as is and makes it difficult to help you :slight_smile:

Hi Mark,

My columns field is getting cut off in the post, but the full line is:


The full error message is getting cut off too. I was able to get the whole FATAL error message in the original post. Thank you in advance for looking at my first config file.


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