Logstash的Java过滤器 [英] Java Filter For Logstash

查看:399
本文介绍了Logstash的Java过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你知道如何使用Logstash的Ruby过滤器,这使我能够在Ruby中编写代码,它通常包含在配置文件中,如下所示

You know how there is a Ruby filter for Logstash which enables me to write code in Ruby and it is usually included in the config file as follows

filter {
      ruby {
           code => "...."
      }
}

现在我有两个Jar我希望包含在我的过滤器中的文件,以便我可以根据我在这些Jar文件中的操作处理我的输入。但是,我不能(显然)在ruby代码中包含Jar文件。我一直在寻找解决方案。

Now I have two Jar files that I would like to include in my filter so that the input I have can be processed according to the operations I have in these Jar files. However, I cannot (apparently) include the Jar file in the ruby code. I've been looking for a solution.

推荐答案

为了回答这个问题,我从Elastc.co找到了这个精彩的教程:

So to answer this, I found this wonderful tutorial from Elastc.co:

显示创建新gem的步骤,并稍后将其用作Logstash的过滤器。

Shows the steps to create a new gem and use it as a filter for Logstash later on.

https://www.elastic.co/guide/en/logstash/current/_how_to_write_a_logstash_filter_plugin .html

这篇关于Logstash的Java过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆