当我使用 Logstash 8.1 导入 csv 文件时出现以下错误
I was Getting below error when i'm to import csv file using Logstash 8.1
我在 cmd 提示符下执行以下命令时出现以下错误
C:\Program Files\Elk Stack\logstash-8.1.2\bin>logstash -f ./logstach.conf
Logstach.conf
file => "C:/Users/babus/Downloads/archive/tips.csv"
start_position => "beginning"
sincedb_path => "NULL"
}
filter {
date{
match => [ "timestamp", "MMM dd HH:mm:ss"]
}
csv {
separator =>","
columns => ["total_bill", "tip","sex","smoker","day","time","size"]
}
}
output {
elasticsearch {
hosts=> "localhost:9200"
index => "tips"
}
stdout {}
}```
***Below is the error i'm getting***
logstash -f ./logstach.conf
"Using bundled JDK: C:\Program Files\Elk Stack\logstash-8.1.2\jdk\bin\java.exe"
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Sending Logstash logs to C:/Program Files/Elk Stack/logstash-8.1.2/logs which is now configured via log4j2.properties
[2022-04-18T13:37:58,080][INFO ][logstash.runner ] Log4j configuration path used is: C:\Program Files\Elk Stack\logstash-8.1.2\config\log4j2.properties
[2022-04-18T13:37:58,095][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"8.1.2", "jruby.version"=>"jruby 9.2.20.1 (2.5.8) 2021-11-30 2a2962fbd1 OpenJDK 64-Bit Server VM 11.0.14.1+1 on 11.0.14.1+1 +indy +jit [mswin32-x86_64]"}
[2022-04-18T13:37:58,100][INFO ][logstash.runner ] JVM bootstrap flags: [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djruby.compile.invokedynamic=true, -Djruby.jit.threshold=0, -Djruby.regexp.interruptible=true, -XX:+HeapDumpOnOutOfMemoryError, -Djava.security.egd=file:/dev/urandom, -Dlog4j2.isThreadContextMapInheritable=true, --add-opens=java.base/java.security=ALL-UNNAMED, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.nio.channels=ALL-UNNAMED, --add-opens=java.base/sun.nio.ch=ALL-UNNAMED, --add-opens=java.management/sun.management=ALL-UNNAMED]
[2022-04-18T13:37:58,248][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2022-04-18T13:38:02,284][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600, :ssl_enabled=>false}
[2022-04-18T13:38:02,578][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [ \t\r\n], \"#\", \"{\" at line 2, column 6 (byte 15) after input {\r\nfile ", :backtrace=>["C:/Program Files/Elk Stack/logstash-8.1.2/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:189:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:72:in `initialize'", "C:/Program Files/Elk Stack/logstash-8.1.2/logstash-core/lib/logstash/java_pipeline.rb:47:in `initialize'", "C:/Program Files/Elk Stack/logstash-8.1.2/logstash-core/lib/logstash/pipeline_action/create.rb:50:in `execute'", "C:/Program Files/Elk Stack/logstash-8.1.2/logstash-core/lib/logstash/agent.rb:376:in `block in converge_state'"]}
[2022-04-18T13:38:02,763][INFO ][logstash.runner ] Logstash shut down.
[2022-04-18T13:38:02,775][FATAL][org.logstash.Logstash ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby.jar:?]
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby.jar:?]
at C_3a_.Program_20_Files.Elk_20_Stack.logstash_minus_8_dot_1_dot_2.lib.bootstrap.environment.<main>(C:\Program Files\Elk Stack\logstash-8.1.2\lib\bootstrap\environment.rb:94) ~[?:?]
您没有 YAML 文件的输入部分,也没有使用 path 而不是文件输入的文件。
input {
file {
path => "C:/Users/babus/Downloads/archive/tips.csv"
start_position => "beginning"
sincedb_path => "NULL"
}
}
我在 cmd 提示符下执行以下命令时出现以下错误 C:\Program Files\Elk Stack\logstash-8.1.2\bin>logstash -f ./logstach.conf Logstach.conf
file => "C:/Users/babus/Downloads/archive/tips.csv"
start_position => "beginning"
sincedb_path => "NULL"
}
filter {
date{
match => [ "timestamp", "MMM dd HH:mm:ss"]
}
csv {
separator =>","
columns => ["total_bill", "tip","sex","smoker","day","time","size"]
}
}
output {
elasticsearch {
hosts=> "localhost:9200"
index => "tips"
}
stdout {}
}```
***Below is the error i'm getting***
logstash -f ./logstach.conf
"Using bundled JDK: C:\Program Files\Elk Stack\logstash-8.1.2\jdk\bin\java.exe"
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Sending Logstash logs to C:/Program Files/Elk Stack/logstash-8.1.2/logs which is now configured via log4j2.properties
[2022-04-18T13:37:58,080][INFO ][logstash.runner ] Log4j configuration path used is: C:\Program Files\Elk Stack\logstash-8.1.2\config\log4j2.properties
[2022-04-18T13:37:58,095][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"8.1.2", "jruby.version"=>"jruby 9.2.20.1 (2.5.8) 2021-11-30 2a2962fbd1 OpenJDK 64-Bit Server VM 11.0.14.1+1 on 11.0.14.1+1 +indy +jit [mswin32-x86_64]"}
[2022-04-18T13:37:58,100][INFO ][logstash.runner ] JVM bootstrap flags: [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djruby.compile.invokedynamic=true, -Djruby.jit.threshold=0, -Djruby.regexp.interruptible=true, -XX:+HeapDumpOnOutOfMemoryError, -Djava.security.egd=file:/dev/urandom, -Dlog4j2.isThreadContextMapInheritable=true, --add-opens=java.base/java.security=ALL-UNNAMED, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.nio.channels=ALL-UNNAMED, --add-opens=java.base/sun.nio.ch=ALL-UNNAMED, --add-opens=java.management/sun.management=ALL-UNNAMED]
[2022-04-18T13:37:58,248][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2022-04-18T13:38:02,284][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600, :ssl_enabled=>false}
[2022-04-18T13:38:02,578][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [ \t\r\n], \"#\", \"{\" at line 2, column 6 (byte 15) after input {\r\nfile ", :backtrace=>["C:/Program Files/Elk Stack/logstash-8.1.2/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:189:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:72:in `initialize'", "C:/Program Files/Elk Stack/logstash-8.1.2/logstash-core/lib/logstash/java_pipeline.rb:47:in `initialize'", "C:/Program Files/Elk Stack/logstash-8.1.2/logstash-core/lib/logstash/pipeline_action/create.rb:50:in `execute'", "C:/Program Files/Elk Stack/logstash-8.1.2/logstash-core/lib/logstash/agent.rb:376:in `block in converge_state'"]}
[2022-04-18T13:38:02,763][INFO ][logstash.runner ] Logstash shut down.
[2022-04-18T13:38:02,775][FATAL][org.logstash.Logstash ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby.jar:?]
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby.jar:?]
at C_3a_.Program_20_Files.Elk_20_Stack.logstash_minus_8_dot_1_dot_2.lib.bootstrap.environment.<main>(C:\Program Files\Elk Stack\logstash-8.1.2\lib\bootstrap\environment.rb:94) ~[?:?]
您没有 YAML 文件的输入部分,也没有使用 path 而不是文件输入的文件。
input {
file {
path => "C:/Users/babus/Downloads/archive/tips.csv"
start_position => "beginning"
sincedb_path => "NULL"
}
}