我是LogStash世界的新手。才刚开始学。我尝试使用来自类似名称的csv文件的数据创建一个名为Unhealthy_data.config的配置文件。
我的配置文件的内容如下:
input{
file{
path => "D:/01_Users/LogStash/Unhealthy.csv"
start_position => "beginning"
}
filter{
csv{
separator => ","
columns => ["cluster_name","unhealthy_nodes","userid","applicationid","queue","application_type","impact_host","cluster_utilization","queue_utilization","running_containers","running_memory","elapsed_time","tech_datestamp"]
}
}
output{
elasticsearch{
hosts =>"http://localhost:9200"
index => "unhealthy"
document_type => "unhealthy_data"
}
stdout{}
}
}最后一列"tech_datestamp“是日期列。
我无法加载数据并获得以下错误:
C:\ELK\logstash-7.9.1\bin>logstash -f C:\ELK\LogStash\UnhealthyData.config
Sending Logstash logs to C:/ELK/logstash-7.9.1/logs which is now configured via
log4j2.properties
[2020-11-28T07:33:35,924][INFO ][logstash.runner ] Starting Logstash {"
logstash.version"=>"7.9.1", "jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03
9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 25.271-b09 on 1.8.0_271-b09 +indy +
jit [mswin32-x86_64]"}
[2020-11-28T07:33:36,158][WARN ][logstash.config.source.multilocal] Ignoring the
'pipelines.yml' file because modules or command line options are specified
[2020-11-28T07:33:37,058][ERROR][logstash.agent ] Failed to execute ac
tion {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"L
ogStash::ConfigurationError", :message=>"Expected one of [A-Za-z0-9_-], [ \\t\\r
\\n], \"#\", \"=>\" at line 7, column 6 (byte 131) after input{\r\n\tfile{\r\n\t
\tpath => \"D:/01_Users/LogStash/Unhealthy.csv\"\r\n\t\tstart_posi
tion => \"beginning\"\r\n\t}\r\n\tfilter{\r\n\t\tcsv", :backtrace=>["C:/ELK/logs
tash-7.9.1/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "
org/logstash/execution/AbstractPipelineExt.java:183:in `initialize'", "org/logst
ash/execution/JavaBasePipelineExt.java:69:in `initialize'", "C:/ELK/logstash-7.9
.1/logstash-core/lib/logstash/java_pipeline.rb:44:in `initialize'", "C:/ELK/logs
tash-7.9.1/logstash-core/lib/logstash/pipeline_action/create.rb:52:in `execute'"
, "C:/ELK/logstash-7.9.1/logstash-core/lib/logstash/agent.rb:357:in `block in co
nverge_state'"]}
[2020-11-28T07:33:37,355][INFO ][logstash.agent ] Successfully started
Logstash API endpoint {:port=>9600}
[2020-11-28T07:33:42,306][INFO ][logstash.runner ] Logstash shut down.
[2020-11-28T07:33:42,328][ERROR][org.logstash.Logstash ] java.lang.IllegalSta
teException: Logstash stopped processing because of an error: (SystemExit) exit请求
发布于 2020-11-28 02:26:21
在打开筛选部分之前,尚未关闭输入部分。因此,logstash配置编译器将csv过滤器作为csv输入进行互操作。
尝试将final }移到filter部分之后。
https://stackoverflow.com/questions/65045795
复制相似问题