rubygemslogstash

Logstash plugin installed but not found


I am using logstash 2.3.2 and for one of my project I have to save some data in RAM. I asked a question on stackoverflow (Logstash: is it possible to save documents in memory?) to get a filter for that and the most appropriate filter is memcached (even if this one is unofficial).

I downloaded the plugin, I generated the gem file (which is not empty) and I successfully installed the plugin.

enter image description here

However, when i run logsatsh by using this filter in my configuration file, I get the following error:

:reason=>"Couldn't find any filter plugin named 'memcached'. Are you sure this is correct? Trying to load the memcached filter plugin resulted in this error: no such file to load -- logstash/filters/memcached", :level=>:error}

Moreover, when i use the command bin/logstah-plugin list,the filter memcached is not present.

I don't understand why it is happening. I followed this discussion (https://discuss.elastic.co/t/logstash-plugin-installed-but-not-found/24369) but without success !

So, do you know how I can solve this problem ?

Thank you for your attention and your help.

Joe


Solution

  • This is the process to follow:

    A. In logstash-filter-cache-memcached.gemspec modify this line

    s.add_runtime_dependency 'logstash-core', '>= 1.4.0', '< 2.0.0'
    

    to

    s.add_runtime_dependency 'logstash-core', '>= 1.4.0', '< 3.0.0'
    

    B. Run the following command to build your plugin

    > gem build logstash-filter-cache-memcached.gemspec  
    

    C. In your logstash folder, install the plugin:

    > bin/logstash-plugin install /path/to/logstash-filter-cache-memcached/logstash-filter-cache-memcached-0.1.1.gem 
    

    That should yield this:

    Validating /path/to/logstash-filter-cache-memcached/logstash-filter-cache-memcached-0.1.1.gem
    Installing logstash-filter-cache-memcached
    Installation successful
    

    D. Verify your plugin is correctly installed

    > bin/logstash-plugin list | grep cache
    logstash-filter-cache-memcached
    

    E. Run a quick test to see if that works:

    > bin/logstash -t -e 'input{stdin{}} filter {memcached{namespace => "test" host => "localhost:11211" key => "test" field => "message" ttl=>60}} output {stdout{}}'
    

    You should see this:

    memcached plugin doesn't have a version. This plugin isn't well
     supported by the community and likely has no maintainer. {:level=>:warn}
    Configuration OK