# Logstash conf file error

**URL:** <https://discuss.elastic.co/t/logstash-conf-file-error/355566>\
**Category:** Logstash\
**Created:** [March 17, 2024, 10:59pm UTC](https://discuss.elastic.co/t/logstash-conf-file-error/355566 "2024-03-17T22:59:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![deathofangel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deathofangel/32/122428_2.png) [@deathofangel](https://discuss.elastic.co/u/deathofangel)\
**Post date:** [March 17, 2024, 10:59pm UTC](https://discuss.elastic.co/t/logstash-conf-file-error/355566/1 "2024-03-17T22:59:48Z")

</div>

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

```auto
input {
  tcp {
    port => 514
    codec => json
  }
}
output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "logsdb"
  }
}

```

```auto
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) ~[?:?]
...
...
...

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 17, 2024, 11:36pm UTC](https://discuss.elastic.co/t/logstash-conf-file-error/355566/2 "2024-03-17T23:36:27Z")

</div>

There is another thread about getting this error in 8.12.2 [here](https://discuss.elastic.co/t/logstash-error-nameerror-cannot-initialize-java-class-org-logstash-plugins-aliasregistry-java-lang-exceptionininitializererror/355350). No solution, but some suggestions.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 14, 2024, 11:37pm UTC](https://discuss.elastic.co/t/logstash-conf-file-error/355566/3 "2024-04-14T23:37:12Z")

</div>

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