从私有gem存储库安装logstash插件

时间:2018-04-15 08:43:36

标签: plugins logstash

根据Logstash documentation,我更新了我的logstash实例上的Gemfile,以使用我的私有gem存储库作为源而不是rubygems.org:

# This is a Logstash generated Gemfile.
# If you modify this file manually all comments and formatting will be lost.

source "http://my-private-repo/"

运行安装命令时出现此错误:

# /usr/share/logstash/bin/logstash-plugin install logstash-filter-prune
    Validating logstash-filter-prune
    logstash-filter-prune is not a Logstash plugin
    ERROR: Installation aborted, verification failed for logstash-filter-prune

查看logstash-plugin source code我看到它试图验证插件名称是否为" .gem"在它,但当我添加" .gem"它试图从互联网上安装插件的插件名称:

# /usr/share/logstash/bin/logstash-plugin install logstash-filter-prune.gem
Validating logstash-filter-prune.gem
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Connection refused - Failed to open TCP connection to api.rubygems.org:443 (Connection refused - connect(2) for "api.rubygems.org" port 443) (https://api.rubygems.org/latest_specs.4.8.gz)

我错过了什么?

1 个答案:

答案 0 :(得分:0)

在 logstash 7.9.3 上测试:

Usage:
    bin/logstash-plugin install [OPTIONS] [PLUGIN] ...

Parameters:
  [PLUGIN] ...       plugin name(s) or file

Options:
  --version VERSION  version of the plugin to install
  --[no-]verify      verify plugin validity before installation (default: true)
  --preserve         preserve current gem options (default: false)
  --development      install all development dependencies of currently installed plugins (default: false)
  --local            force local-only plugin installation. see bin/logstash-plugin package|unpack (default: false)
  -h, --help         print help

尝试使用:

logstash-plugin install --no-verify --local /path/to/logstash-filter-prune.gem

for gemname in /path/to/logstash-*.gem; do
    [ -e "$gemname" ] || continue
    logstash-plugin install --no-verify --local "/path/to/${gemname}"
done