Logstash input elasticsearch argument error

Hello. Im trying to setup my logstash to take docs from elastic and output them to console and im getting the following error

[ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"Java::JavaLang::IllegalStateException", :message=>"Unable to configure plugins: (ArgumentError) Cannot determine timezone from nil\n(secs:1670312766.191,utc~:"2022-12-06 07:46:06.19099998474121094",ltz~:nil)\n(etz:nil,tnz:"ALMT",tziv:"2.0.5",tzidv:"1.2022.6",rv:"2.6.8",rp:"java",win:true,rorv:nil,astz:nil,eov:"1.2.7",eotnz:"???",eotnfz:"???",eotlzn:"???",\ndebian:nil,centos:nil,osx:nil)\nTry setting ENV['TZ'] = 'Continent/City' in your script (see List of tz database time zones - Wikipedia)", :backtrace=>["org.logstash.config.ir.CompiledPipeline.(CompiledPipeline.java:120)", "org.logstash.execution.JavaBasePipelineExt.initialize(JavaBasePipelineExt.java:85)", "org.logstash.execution.JavaBasePipelineExt$INVOKER$i$1$0$initialize.call(JavaBasePipelineExt$INVOKER$i$1$0$initialize.gen)", "org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:846)", "org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1229)", "org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuperSplatArgs(IRRuntimeHelpers.java:1202)", "org.jruby.ir.targets.indy.InstanceSuperInvokeSite.invoke(InstanceSuperInvokeSite.java:29)", "C_3a_.C_23__Projects.ELASTICSEARCH.logstash_minus_8_dot_5_dot_1_minus_windows_minus_x86_64.logstash_minus_8_dot_5_dot_1.logstash_minus_core.lib.logstash.java_pipeline.RUBY$method$initialize$0(C:/C#Projects/ELASTICSEARCH/logstash-8.5.1-windows-x86_64/logstash-8.5.1/logstash-core/lib/logstash/java_pipeline.rb:48)", "org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:139)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:112)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87)", "org.jruby.RubyClass.newInstance(RubyClass.java:911)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)", "org.jruby.ir.targets.indy.InvokeSite.invoke(InvokeSite.java:208)", "C_3a.C_23__Projects.ELASTICSEARCH.logstash_minus_8_dot_5_dot_1_minus_windows_minus_x86_64.logstash_minus_8_dot_5_dot_1.logstash_minus_core.lib.logstash.pipeline_action.create.RUBY$method$execute$0(C:/C#Projects/ELASTICSEARCH/logstash-8.5.1-windows-x86_64/logstash-8.5.1/logstash-core/lib/logstash/pipeline_action/create.rb:50)", "C_3a.C_23__Projects.ELASTICSEARCH.logstash_minus_8_dot_5_dot_1_minus_windows_minus_x86_64.logstash_minus_8_dot_5_dot_1.logstash_minus_core.lib.logstash.pipeline_action.create.RUBY$method$execute$0$VARARGS(C:/C#Projects/ELASTICSEARCH/logstash-8.5.1-windows-x86_64/logstash-8.5.1/logstash-core/lib/logstash/pipeline_action/create.rb:49)", "org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:139)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:112)", "org.jruby.ir.targets.indy.InvokeSite.invoke(InvokeSite.java:208)", "C_3a.C_23__Projects.ELASTICSEARCH.logstash_minus_8_dot_5_dot_1_minus_windows_minus_x86_64.logstash_minus_8_dot_5_dot_1.logstash_minus_core.lib.logstash.agent.RUBY$block$converge_state$2(C:/C#Projects/ELASTICSEARCH/logstash-8.5.1-windows-x86_64/logstash-8.5.1/logstash-core/lib/logstash/agent.rb:386)", "org.jruby.runtime.CompiledIRBlockBody.callDirect(CompiledIRBlockBody.java:141)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:64)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58)", "org.jruby.runtime.Block.call(Block.java:143)", "org.jruby.RubyProc.call(RubyProc.java:309)", "org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:107)", "java.base/java.lang.Thread.run(Thread.java:833)"]}
[2022-12-06T13:46:09,776][INFO ][logstash.runner ] Logstash shut down.
[2022-12-06T13:46:09,781][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:790) ~[jruby.jar:?]
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:753) ~[jruby.jar:?]
at C_3a
.C_23__Projects.ELASTICSEARCH.logstash_minus_8_dot_5_dot_1_minus_windows_minus_x86_64.logstash_minus_8_dot_5_dot_1.lib.bootstrap.environment.(C:\C#_Projects\ELASTICSEARCH\logstash-8.5.1-windows-x86_64\logstash-8.5.1\lib\bootstrap\environment.rb:91) ~[?:?]

My config looks like this

input {
elasticsearch {
hosts => "localhost"
query => '{ "query": { "match": { "statuscode": 200 } }, "sort": [ "_doc" ] }'
}
}
output
{
stdout {}
}

can someone tell me what's the problem and how to fix it?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.