问题标签 [fluentd]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
419 浏览

json - Hive 为 Fluentd Apache 日志数据创建表语句

我正在使用 Fluentd 在 HDFS 中捕获和整合 Apache 日志数据。我配置代理将数据写入HDFS,即/etc/td-agent/td-agent.conf文件包含:

我根据Fluentd 文档启用了 HDFS 附加功能。数据完美地流过。在过去的几周里,它一直在无故障地传输数百万笔交易。

数据存储在包含如下行的文件中:

每行包含三个制表符分隔的元素:

  1. 时间戳
  2. 识别标签
  3. JSON 包含 Apache 日志中列的键/值对

我正在尝试创建一个 Hive 表,但不确定如何处理它是每行上的制表符分隔字符串和 JSON 混合的事实。我知道 Hive 有一个 JSON 反序列化器,但我认为这不会起作用,因为记录不是纯 JSON。

有没有人建议如何为这些数据编写创建表语句?

0 投票
1 回答
1738 浏览

logging - 如何将日志文件转发到fluentd

我想用 kibana 和 fluentd 设置 elasticsearch。我有两台机器。机器 1 用作日志文件的来源。每个 http 请求都会创建日志,每个请求都存储在单独的日志文件中。日志路径结构类似于 /path/year/month/day/hour/*.log。我想将 elasticsearch 与安装在机器 2 上的 kibana 一起使用。

我读过一些关于流利的转发器和聚合器的东西,我也读过关于前向输出插件的东西。但我仍然不确定如何设置这台机器。通常转发器用于发送单个日志文件,但我有多个文件。

您能否指出正确的方向如何在两台机器上设置 fluentd,以便我可以在机器 1 的机器 2 日志上使用 kibana 浏览。

一个日志文件的格式:

任何帮助将不胜感激。

谢谢

0 投票
1 回答
1002 浏览

apache - td-agent 不适用于 apache 日志

我需要一个帮助,我还在我的 ubuntu 12.04 上使用 td-agent 最新版本将 apache 日志解析到 mongodb,如果我在配置中输入“无格式”,那么它会创建一个 mongo 文档并将所有内容推送到消息密钥,但是当我说“format apache”或“format apache2”或“format /^***********$/”(这是 td-agent 本身给出的 apache 正则表达式)时,它只是说模式不是匹配,

我检查了权限,其他方式等等,但没有得到解决方案,请帮助我,如果你能够使用 td-agent(Fluentd) 运行你的日志项目。

或者我应该转向 Logtrash 来完成这个项目。

/var/log/td-agent/td-agent.log 警告如下。

2015-02-09 18:41:39 +0530 [警告]:模式不匹配:“192.168.100.11:80 192.168.100.11 - - [09/Feb/2015:18:41:39 +0530] \"POST / get_details HTTP/1.1\" 200 580 \" http://192.168.100.11/login \" \"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0\""

2015-02-09 18:41:39 +0530 [警告]:模式不匹配:“192.168.100.11:80 192.168.100.11 - - [09/Feb/2015:18:41:39 +0530] \"POST / get_user HTTP/1.1\" 200 365 \" http://192.168.100.11/login \" \"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0\""

谢谢,威廉姆斯。

0 投票
2 回答
4507 浏览

logging - 12Factor 应用程序:使用 Fluentd 捕获标准输出/标准错误日志

通过阅读12factor的以下帖子,我想出了一个问题,我想看看你们是如何处理这个问题的。

基本上,应用程序应该直接写入 stdout/stderr。无论如何将这些流直接重定向到fluentd(不绑定到rsyslog/syslog)?随着我越来越了解 fluentd,我相信它将成为来自多个应用程序/平台的日志聚合的绝佳工具。

这样做的主要原因是,如果应用程序是跨平台的,rsyslog/syslog 可能不可用,据我了解,使用日志框架(需要所需的配置才能工作)将违反 12factor。

谢谢!

0 投票
1 回答
4482 浏览

regex - Fluentd 日志源格式 RegEX

我有这种格式的日志:

我想出了这个正则表达式:

当我在Fluentular中进行测试时 (我将使用它作为 fluentd 日志输入的格式),我得到以下字段:

我无法破坏消息字符串。我希望匹配的组是:

什么是正确的正则表达式

0 投票
1 回答
900 浏览

elasticsearch - 将 id_key 与 fluentd/elasticsearch 一起使用

我最近开始尝试使用 fluentd + elasticsearch + kibana 设置。
我目前正在通过 fluentd 提供信息,方法是让它读取我用 python 代码吐出的日志文件。
日志由 json 数据列表组成,每行一个,如下所示:

我有流利的设置来读取我的字段“id”并按照此处的说明填写“_id” :

但是,插入上面的“_id”仍然是随机生成的_id。
如果有人能指出我做错了什么,我将不胜感激。

0 投票
1 回答
2260 浏览

syslog - Remove duplicate remote syslog messages

For redundancy, every host in our distributed network sends its syslog messages to two dedicated rsyslog-nodes. These in turn send syslogs to a central graylog instance:

Now every log-message gets duplicated!

Question: How can we keep the redundancy but remove duplicates? Does fluentd have a way to deal with this? Or any other opensource software designed to aggregate log-messages? We do not want to include much more complexity to the whole setup, but inserting one additional component is fine.

0 投票
1 回答
2325 浏览

logging - Fluentd copy output plugin not sending same data to both destinations?

I have a web server stack with multiple nodes (auto scaling group), and each web server is configured to use Fluentd to forward log files to a central collector which saves the logs in an S3 bucket.

I am testing a new collector, and configured the web servers to send a copy of an access log to both the old and the new collector, but there is a huge discrepancy in the aggregated files.

The old collector is saving 2x the log data. I can't figure out for the life of me what the issue is, unless the data is getting lost somewhere on the way to the new collector (and how could I best test this?).

Web server td-agent.conf

The log collectors have the exact same config... so no need to look there.

0 投票
1 回答
685 浏览

elasticsearch - 如何在弹性搜索和 Kibana4 中映射自定义日期格式

我有 nginx 日志,我有这个日期格式 [02/Mar/2015:13:02:51 +0000]

我应该在 elasticsearch 中使用什么以及应该在 Kibana4 的 dateformat 字段中添加什么?

以上我在 Kibana 中看不到任何数据(事件)

谢谢

0 投票
1 回答
753 浏览

postgresql - 无法在 ubuntu 14.04.1 上安装 fluentd redshift 插件找不到 PostgreSQL 客户端库 (libpq)

这是一个全新的 AWS ubuntu 14.04.1 VM。

启动它后,尝试安装 fluentd redshift 插件。

应该很容易重现。请帮忙。非常感谢。

mkft.log 文件有以下内容: