简体   繁体   English

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

[英]Install logstash plugin from private gem repository

According to Logstash documentation , I updated the Gemfile on my logstash instance to use my private gem repository as source instead of rubygems.org:根据 Logstash 文档,我更新了我的 logstash 实例上的 Gemfile 以使用我的私有 gem 存储库作为源而不是 ruby​​gems.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/"

When running the command to install I get this error:运行安装命令时出现此错误:

# /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

Looking at the logstash-plugin source code I see that it tries to validate that the plugin name has ".gem" in it, but when I add ".gem" to the plugin name it tries to install the plugin from the internet:查看 logstash-plugin 源代码,我看到它尝试验证插件名称中是否包含“.gem”,但是当我将“.gem”添加到插件名称时,它会尝试从 Internet 安装插件:

# /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)

What am I missing?我错过了什么?

Tested on logstash 7.9.3:在 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

Try to use:尝试使用:

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

or

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM