New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

logstash-filter-device_detector

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logstash-filter-device_detector

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

logstash-filter-device_detector

说明

这是一个基于ruby语言的logstash filter插件,用来解析http_user_agent,调用了外部库。

开发环境测试

1. 插件开发环境和测试

Code
  • 首先,您需要安装了Bundler gem的JRuby。
  • 执行下面的命令安装依赖
bundle install
Test
  • Update your dependencies
bundle install
  • Run tests
bundle exec rspec

这里在windows可能执行失败,暂时没研究什么原因。

2. 在logstash中运行未发布的插件

以下方式2选一即可

2.1 直接在logstash使用克隆下来的插件代码

进入logstash安装目录,一般是/usr/share/logstash

  • 编辑 Gemfile ,添加本地插件路径,如下所示:
gem "logstash-filter-device_detector", :path => "/path/to/logstash-filter-device-detector"
  • 安装插件
bin/logstash-plugin install --no-verify
  • 运行logstash测试此插件
cd /etc/logstash/conf.d
vim test.conf
# 添加如下内容
input {
   stdin {}
}
filter {
  device_detector {
      source => "message"
  }
}
output {
  stdout { codec => rubydebug }
}
# 运行logstash
/usr/share/logstash/bin/logstash -f test.conf

然后在屏幕输入useragent就可以看到效果了。

2.2 在logstash安装构建好的gem插件
  • 构建gem
gem build logstash-filter-device-detector.gemspec
  • 进入logstash安装目录,安装gem插件
bin/logstash-plugin install /path/to/logstash-filter-device_detector-0.1.1.gem

安装在线插件

bin/logstash-plugin install logstash-filter-device_detector

FAQs

Package last updated on 15 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc