JPcode
JPcode

Reputation: 90

logstash Expected one of [ \\t\\r\\n], \"#\", \"input\", \"filter\", \"output\" at line 1, column 1 (byte 1)",

I get an error at line 1 column one but I don't know what's happening.

I already tried some things I found in other posts:

This is the pipelines.yml that Im using

-pipeline.id: KafkaES-process
 queue.type:persisted
 config.string: |
    input{ kafka{
    bootstrap_servers => "localhost:9092"
    topics => ["topic_es"]
    }
    }
    filter{
    json{
    source=> "message"
    }
    mutate{
    remove_field => "message"
    }
    }
    output{
    elasticsearch{
    hosts => ["localhost:9200"]
    index => "houses_index"
    }
    }

This is how I call it

C:/Users/user/Downloads/logstash-7.15.2/bin/logstash -f pipelines.yml

Any ideas/questions are welcomed.

Upvotes: 0

Views: 812

Answers (1)

Badger
Badger

Reputation: 4072

You do not use -f to point to pipelines.yml, you use it to point to a file or directory that contains your pipeline configuration. You could take the value of config.string, put that if a file called my.conf, and then run logstash -f my.conf.

The error message is complaining about the - which is the first character of the YAML.

Put the pipelines.yml file in your path.settings directory and start logstash using

C:/Users/user/Downloads/logstash-7.15.2/bin/logstash

Upvotes: 2

Related Questions