HI,@danhermann,I'm from github issue (https://github.com/elastic/logstash/issues/10680), the promble transf here
logstash compile version: 7.1.2, logstash running version: 7.1.1
java_codec_example.rb file content
# encoding: utf-8
require "logstash/codecs/base"
require "logstash/namespace"
require "logstash-codec-java_codec_example_jars"
require "java"
class LogStash::Codecs::JavaCodecExample < LogStash::Codecs::Base
config_name "java_codec_example"
def self.javaClass() org.logstash.javaapi.JavaCodecExample.java_class; end
end
logstash-codec-java_codec_example_jars.rb file content
require 'jar_dependencies'
require_jar('org.logstash.javaapi', 'logstash-codec-java_codec_example', '7.1.2')
logstash-codec-java_codec_example.gemspec file content
Gem::Specification.new do |s|
s.name = 'logstash-codec-java_codec_example'
s.version = '7.1.2'
s.licenses = ['Apache-2.0']
s.summary = "Example codec using Java plugin API"
s.description = ""
s.authors = ['Elasticsearch']
s.email = 'info@elastic.co'
s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
s.require_paths = ['lib', 'vendor/jar-dependencies']
# Files
s.files = Dir["lib//*","spec//",".gemspec",".md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/.jar", "vendor/jar-dependencies//*.rb", "VERSION", "docs//*"]
# Special flag to let us know this is actually a logstash plugin
s.metadata = { 'logstash_plugin' => 'true', 'logstash_group' => 'codec'}
# Gem dependencies
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
s.add_runtime_dependency 'jar-dependencies'
s.add_development_dependency 'logstash-devutils'
end
not set logstash config file,logstash run command:
./bin/logstash --debug --verbose --java-execution -e 'input { java_stdin { codec => java_codec_example } }'