LogStash配置问题



我是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_ testamp";是"日期"列。

我无法加载数据并获得如下错误:-

C:ELKlogstash-7.9.1bin>logstash -f C:ELKLogStashUnhealthyData.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{rntfile{rnt
tpath => "D:/01_Users/LogStash/Unhealthy.csv"rnttstart_posi
tion => "beginning"rnt}rntfilter{rnttcsv", :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

请求

在打开过滤器部分之前,您没有关闭输入部分。因此,logstash配置编译器将csv过滤器作为csv输入插入

请尝试将final}移到筛选器部分之后。

最新更新