Jira的Logstash Shipper配置 [英] Logstash Shipper configuration for Jira

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

问题描述

我在公司内部运行Jira和Confluence.我希望将日志文件发送到Kibana.

I am running Jira and Confluence within my company. I would like the logfiles to be shipped to Kibana.

这很容易做到,但是我不想重写Grok过滤器.我无法想象没有人这样做.

This is very easy to do but I do not want to rewrite the Grok filters. I cannot imagine that nobody has done this already.

有人有logstash托运人配置的示例吗?像catalina.log这样的大多数日志记录都是标准的.

Does anybody have an example of a logstash shipper configuration. Most of the logging like catalina.log is standard.

请帮我举个例子

推荐答案

人们会认为Java应用程序日志仅以一种形式出现,但是我的经验是,通常存在细微的差异.有时线程名称放在方括号中,有时放在括号中,有时线程名称在记录器名称之后排在第一位,而在其他时候等等.当您尝试解析一种以上类型的日志时,这会变得更加痛苦.

One would think that Java application logs only come in one form, but my experience is that there often are subtle differences. Sometimes the thread name is in square brackets and sometimes in parentheses, sometimes the thread name goes first and other times after the logger name, and so on. This gets more painful as you attempt to parse more than one type of log.

我非常喜欢使用

Instead of messing with various filters to join multiline messages and grok all the fields I strongly favor using the Log4j layout in github.com/logstash/log4j-jsonevent-layout to produce JSON-based logs that Logstash can read directly without any filters. Apart from not having to maintain filters you get all fields from each log event. Since I don't know what your catalina.log looks like I can't say what you'd be missing by parsing its contents instead of using the JSON layout.

缺点是在部署方面需要更多工作.显然,您必须自己部署布局jar文件,但是它也有几个依赖项(net.minidev:jsonsmart和commons-lang:commons-lang),您也需要使它们可用.

The drawback is that it's a bit more work deployment-wise. You obviously have to deploy the layout jar file itself, but it has a couple of dependencies of its own (net.minidev:jsonsmart and commons-lang:commons-lang) that you need to make available too.

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

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