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

0

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:

  • Changing from utf-8 to utf-8 BOM to ANSI
  • Changing to Linux LF and
  • Windows CRLF retyping the whole file
  • I have checked in notepad++ (view -> show all characters) that there arent any other symbols
  • I even tried copying the example that logstash gives of a pipelines.yml

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.

apache-kafka elasticsearch logstash
2021-11-23 23:36:36
1

2

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
2021-11-24 00:52:29

I got the file in config, and ran it like that, now I got this: Failed to read pipelines yaml file. Location: C:/Users/user/Downloads/logstash-7.15.2/config/pipelines.yml Is there something else I have to do or missed?
JPcode

Im doing a pipeline file because after this works I need to connect it to a db. For now Im just trying this simple version to see it working.
JPcode

Its working now, it was just a bad identation. Thank you!
JPcode

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................