OS: Redhat 7
Logstash Version: 6.5.1
The following logstash pipeline.conf:
# !!!Attenttion: Comments can raise exceptions -> be aware!!!
input {
beats {
port => "5044"
host => "0.0.0.0"
}
}
output {
if [input][type] == "log" {
elasticsearch {
hosts => [ "10.10.158.141:9200" ]
manage_template => false
index => "whatever-%{+YYYY.MM.dd}"
}
}
}
Raises the exception:
[LogStash::Runner] runner - The given configuration is invalid. Reason: Expected at line 1, column 63 (byte 63) after
# !!!Attenttion: Comments can raise exceptions -> be aware!!!
The config file pasted here is an abstraction of the config that originally lead to my problem.
This started to appear suddenly after a change of the config.
As I have the config files in a repository, I first thought it might be a hidden character or something like that and so I rolled it back to a previous version of the config file, but the problem remained.
Logstash Runner still returned an error in a comment line. So I removed the line and checked again -> then I saw the same exception but on the next comment line. It resulted in removing all comments from the file and finally there were no more exceptions and it ran fine again.
Afterwards I exchanged with a colleague and he told me he had exactly the same issue before and that he had to remove all comments as well to get it working.
What is interesting here ist that the runner always complains about the last character in the line, which is simply a carriage return with line feed