logstash启动报配置文件错误Expected one of #, input, filter, output at line 1, column 1 (byte 1) after
2018-03-02 14:16
525 查看
运行环境:windows环境下
在部署logstash到服务器的时候遇到这个问题,就是配置文件什么的都写好了运行,然后出错如图:
然后根据提示去找配置文件哪里出现问题,配置文件的图如下:
结果找了老半天没发现错误,于是用命令:logstash -f ../config/logstash-simple-dev.conf -t
去测试配置文件是否正常。结果显示无效配置文件,也就是说配置文件出错了
提示Expected one of #, input, filter, output at line 1, column 1 (byte 1) after 。
可是我第一行没错啊,是以input开头的啊。最后经过各种测试各种排查(难受)发现是文件编码的问题。原来我这个配置文件logstash-simple-dev.conf的编码是UTF-8 BOM也就是第一行就东西的只是我们看不到而已,解决方案就是把文件换成UTF-8编码格式就行无Bom模式的。
问题:配置文件提示出错Expected one of #, input, filter, output at line 1, column 1 (byte 1) after 。
解决方案:文件编码格式问题导致第一行有隐藏文件头,改为UTF-8无BOM模式(也就是UTF-8模式就行)。
在部署logstash到服务器的时候遇到这个问题,就是配置文件什么的都写好了运行,然后出错如图:
然后根据提示去找配置文件哪里出现问题,配置文件的图如下:
结果找了老半天没发现错误,于是用命令:logstash -f ../config/logstash-simple-dev.conf -t
去测试配置文件是否正常。结果显示无效配置文件,也就是说配置文件出错了
提示Expected one of #, input, filter, output at line 1, column 1 (byte 1) after 。
可是我第一行没错啊,是以input开头的啊。最后经过各种测试各种排查(难受)发现是文件编码的问题。原来我这个配置文件logstash-simple-dev.conf的编码是UTF-8 BOM也就是第一行就东西的只是我们看不到而已,解决方案就是把文件换成UTF-8编码格式就行无Bom模式的。
问题:配置文件提示出错Expected one of #, input, filter, output at line 1, column 1 (byte 1) after 。
解决方案:文件编码格式问题导致第一行有隐藏文件头,改为UTF-8无BOM模式(也就是UTF-8模式就行)。
相关文章推荐
- Expected one of #, input, filter, output at line 2, column 1 (byte 2): Logstash
- reason=>"Expected one of #, input, filter, output at line 1, column 1 (byte 1) after "}
- android retrofit End of input at line 1 column 1 path
- android retrofit End of input at line 1 column 1 path
- C语言错误:expected declaration or statement at end of input
- 错误: expected declaration or statement at end of input
- Qt5:"Designer: An error has occurred while reading the UI file at line 1, column 0: Premature end of document."错误
- C语言错误:expected declaration or statement at end of input
- C语言错误:expected declaration or statement at end of input
- 项目启动时报 web.xml; lineNumber: 1; columnNumber: 1; 文件提前结束 错误
- 启动tomcat是出现错误( Parse Fatal Error at line 1 column 1: Content is not allowed in prolog.)
- 严重: Parse Fatal Error at line 154 column 33: Invalid byte 2 of 2-byte UTF-8 sequence.
- 关于SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data错误的解决
- error: expected declaration or statement at end of input
- struts2配置文件错误(The content of element type “package” must match**)
- sax解析xml文件出现编码错误问题Invalid byte 1 of 1-byte UTF-8 sequence.
- dll文件加载运行加载的14001错误,由于应用程序配置不正确,应用程序未能启动
- XML文件要有根标签(Extra content at the end of the document in file 错误)
- VC++ 6.0 建立类向导(class wizard)错误提示Parsing error: Expected =.Input Line:
- asp.net 生成导出word表单 ,导出excel; dataTable生成xls文件,返回前台下载;asp.net启动excel错误 80070005;excel-xls columnName 不能改变; 读写excel的开源利器NPOI; 设置excel Cell的数据类型;