Json_encode filter issues


(B Iitzkrieg) #1

I am trying to use the json_encode filter in my logstash config.

I have installed the plugin via /opt/logstash/bin/logstash-plugin install logstash-filter-json_encode
It returns " installation successful"

My logstash config is:

filter {
json_encode{
source => "message"
}
}

Yet my logstash log reports:

Cannot create pipeline {:reason=>"Couldn't find any filter plugin named 'json_encode'.


(Imma) #2

Can you check that the plugin is installed?

/opt/logstash/bin/logstash-plugin list logstash-filter-json_encode

What version of logstash are you running, and on what operating system?


(B Iitzkrieg) #3

It returns:
Gem::LoadError: You have already activated minitar 0.6.1, but your Gemfile requires minitar 0.5.4. Prepending bundle exec to your command may solve this.
setup at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/runtime.rb:34
each at org/jruby/RubyArray.java:1613
each at /opt/logstash/vendor/jruby/lib/ruby/1.9/forwardable.rb:201
setup at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/runtime.rb:19
setup at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler.rb:122
setup! at /opt/logstash/lib/bootstrap/bundler.rb:64
execute at /opt/logstash/lib/pluginmanager/list.rb:17
run at /opt/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67
execute at /opt/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/subcommand/execution.rb:11
run at /opt/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67
run at /opt/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132
(root) at /opt/logstash/lib/pluginmanager/main.rb:43

I'm on logstash 2.4.1, could this be a version issue? I believe the json_encode plugin is a more recent release and 2.4.1 may not support it.


(Imma) #4

I don't think that's a problem. I tried installing on a logstash 2.4.1 from scratch and it worked. Can you try it on a clean install?


(B Iitzkrieg) #5

Sorry, forgot to mention I am on CentOS 7.3.1611

I will try on a clean install as soon as possible.


(system) #6

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