Logstash conf file error

Hello
I need to constantly listen to a port and direct the json format logs coming there to elastic. I created a logstash.conf for this situation. But I always get the same error. logstash verison 8.12.2

input {
  tcp {
    port => 514
    codec => json
  }
}
output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "logsdb"
  }
}
C:\Users\xx\Desktop\ELK\logstash-8.12.2\bin>logstash -f C:/Users/xx/Desktop/ELK/logstash-8.12.2/bin/logstash.conf
"Using bundled JDK: C:\Users\xx\Desktop\ELK\logstash-8.12.2\jdk\bin\java.exe"
C:/Users/xx/Desktop/ELK/logstash-8.12.2/vendor/bundle/jruby/3.1.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/java_thread_pool_executor.rb:13: warning: method redefined; discarding old to_int
C:/Users/xx/Desktop/ELK/logstash-8.12.2/vendor/bundle/jruby/3.1.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/java_thread_pool_executor.rb:13: warning: method redefined; discarding old to_f
[FATAL] 2024-03-17 23:44:11.682 [main] Logstash - Logstash stopped processing because of an error: (NameError) cannot initialize Java class org.logstash.plugins.AliasRegistry (java.lang.ExceptionInInitializerError)
org.jruby.exceptions.NameError: (NameError) cannot initialize Java class org.logstash.plugins.AliasRegistry (java.lang.ExceptionInInitializerError)
        at org.jruby.javasupport.JavaPackage.method_missing(org/jruby/javasupport/JavaPackage.java:253) ~[jruby.jar:?]
        at RUBY.initialize(C:/Users/xx/Desktop/ELK/logstash-8.12.2/logstash-core/lib/logstash/plugins/registry.rb:126) ~[?:?]
        at org.jruby.RubyClass.new(org/jruby/RubyClass.java:897) ~[jruby.jar:?]
        at RUBY.<module:LogStash>(C:/Users/xx/Desktop/ELK/logstash-8.12.2/logstash-core/lib/logstash/plugins/registry.rb:342) ~[?:?]
        at RUBY.<main>(C:/Users/xx/Desktop/ELK/logstash-8.12.2/logstash-core/lib/logstash/plugins/registry.rb:25) ~[?:?]
        at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1071) ~[jruby.jar:?]
        at RUBY.<main>(C:/Users/xx/Desktop/ELK/logstash-8.12.2/logstash-core/lib/logstash/plugins.rb:18) ~[?:?]
...
...
...

There is another thread about getting this error in 8.12.2 here. No solution, but some suggestions.

2 Likes

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