简体   繁体   English

使用 Logstash+ logstash forwarder+ kibana+Elasticsearch 自定义日志

[英]Custom log with Logstash+ logstash forwarder+ kibana+Elasticsearch

I have configured Logstash+ logstash forwarder + kibana + Elasticsearch.我已经配置了Logstash+ logstash forwarder + kibana + Elasticsearch。 Its working with system logs like Apache error logs & syslogs.它处理系统日志,如 Apache 错误日志和系统日志。 Now, I have a application log, Like below,现在,我有一个应用程序日志,如下所示,

Sender: sender@domain.com create_time: Thu Sep 4 02:41:54 2014 recipient: automation@domain.com发件人:sender@domain.com 创建时间:2014 年 9 月 4 日星期四 02:41:54 收件人:automation@domain.com

How can i read the above log file through kibana.如何通过 kibana 读取上述日志文件。 Kindly someone help me in this regard.请有人在这方面帮助我。 Your help much appropriated.你的帮助非常合适。

Your logstash should analyze your logs before to push them into elasticsearch.您的 logstash 应该先分析您的日志,然后再将它们推送到 elasticsearch 中。

I think that currently, your logstash has an input (lumberjack) and an output (ES).我认为目前,您的 logstash 有一个输入(伐木工人)和一个输出(ES)。 You should add at least one grok filter (the most popular) to extract new semantic fields.您应该至少添加一个 grok 过滤器(最流行的)来提取新的语义字段。

Then you will be able to create visualizations according to these new fields :)然后您将能够根据这些新字段创建可视化:)

See here: logstash.net/docs/1.4.2/filters/grok见这里:logstash.net/docs/1.4.2/filters/grok

Use logstash forwarder to export logs and send the logs to logstash [ via lumberjack protocol].使用 logstash forwarder 导出日志并将日志发送到 logstash [通过伐木工人协议]。

In logstash filter plugin, use grok pattern for apache logs to get this working and output this elasticsearch node.在 logstash 过滤器插件中,对 apache 日志使用 grok 模式以使其正常工作并输出此 elasticsearch 节点。

You can then use kibana to read the data from elasticsearch and visualise it accordingly.然后,您可以使用 kibana 从 elasticsearch 读取数据并相应地对其进行可视化。

Now, this can be replaced by using filebeat at the source end which can export the data and requires no development in logstash for something like apache logs.现在,这可以通过在源端使用 filebeat 来代替,它可以导出数据并且不需要在 logstash 中开发类似 apache 日志的东西。 This will enable you to send data from filebeat [ apache logs] directly to elasticsearch and visualise from kibana.这将使您能够将数据从 filebeat [apache 日志] 直接发送到 elasticsearch 并从 kibana 进行可视化。

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

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