我想知道如何在Fluentd配置中使用env vars,我试过:
<match **>
type elasticsearch
logstash_format true
logstash_prefix $ENV_VAR
host ***
port ***
include_tag_key true
tag_key _key
</match>
Run Code Online (Sandbox Code Playgroud)
但它不起作用,任何想法?
I am using fluentd to centralize log messages in elasticsearch and view them with kibana. When I view log messages, messages that occured in the same second are out of order and the milliseconds in @timestamp is all zeros
2015-01-13T11:54:01.000-06:00 DEBUG my message
Run Code Online (Sandbox Code Playgroud)
How do I get fluentd to store milliseconds?
我目前有以下配置:
<match docker.nginx>
@type rewrite_tag_filter
rewriterule1 source stdout docker.nginx.stdout
rewriterule2 source stderr docker.nginx.stderr
</match>
Run Code Online (Sandbox Code Playgroud)
但这意味着,每个容器我必须做同样的事情.
这不起作用,但可能你会得到我想要的东西:
<match docker.*>
@type rewrite_tag_filter
rewriterule1 source stdout docker.*.stdout
rewriterule2 source stdout docker.*.stderr
</match>
Run Code Online (Sandbox Code Playgroud)
所以我的问题是我可以以某种方式引用匹配块中匹配的标签吗?因此,如果它是nginx/rabbitmq/zookeeper/anything,它会将所有事件流拆分为docker.<fluentd-tag>.stdout和stderr.
提前致谢!
我在 docker 容器上运行 fluentd 图像。当我使用 telnet(或 netcat)打开 TCP 连接并发送“消息”字符串时,会出现以下消息:
2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1,
addr: 192.168.99.1, port: 12345" msg=109
2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1,
addr: 192.168.99.1, port: 12345" msg=101
2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1,
addr: 192.168.99.1, port: 12345" msg=115
2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1,
addr: 192.168.99.1, port: 12345" msg=115
2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1,
addr: …Run Code Online (Sandbox Code Playgroud) 我正在设置我的fluentD配置,对于某些事件,我需要将它们推送到loggly和elasticsearch.我正在使用复制插件,但看到fluentD调用返回所花费的时间差异很大 - 通过邮递员进行测试POST调用所花费的时间.如果我使用弹性搜索匹配内部副本vs <1s进行直接弹性搜索匹配,则需要大约5秒.我使用以下配置.
<match testapp.elastic>
@type elasticsearch
host localhost
port 9200
index_name fluentdtest
type_name fluentdtest
</match>
#Common match for loggly and mongo
<match logapp.**>
type copy
<store>
@type elasticsearch
host localhost
port 9200
index_name fluentdtest
type_name fluentdtest
</store>
<store>
type forest
subtype loggly
<template>
loggly_url ##myurl##/tag/${tag}
</template>
</store>
</match>
Run Code Online (Sandbox Code Playgroud) 我最近一直在阅读有关 Fluentd 和 Fluent-bit 作为日志统一和收集工具的内容。文档说它支持一些 Linux 发行版,但我找不到任何关于 Android 的参考 - 无论是支持还是不支持。
知道 Fluent-bit 是否可以编译在 Android 上运行吗?或者,是否还有其他工具,例如 Android 版 Fluent-bit?
谢谢
我有如下日志:
{
"log": {
"header": {
"key": "value",
"nested": "{\"key1\":\"value\",\"key2\":\"value\"}",
"dateTime": "2019-05-08T20:58:06+00:00"
},
"body": {
"path": "/request/path/",
"method": "POST",
"ua": "curl/7.54.0",
"resp": 200
}
}
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用 fluentd 聚合日志,并且我希望整个记录都是 JSON。具体问题是“$.log.header.nested”字段,它是一个JSON字符串。如何解析该字符串并将其替换为其内容?
为清楚起见,我希望 fluentd 输出的日志如下所示:
{
"log": {
"header": {
"key": "value",
"nested": {
"key1": "value",
"key2": "value"
},
"dateTime": "2019-05-08T20:58:06+00:00"
},
"body": {
"path": "/request/path/",
"method": "POST",
"ua": "curl/7.54.0",
"resp": 200
}
}
}
Run Code Online (Sandbox Code Playgroud)
我找到了一种将嵌套字段解析为 JSON 的方法,但存储回它解析的同一个键尚不清楚。似乎不hash_value_field支持存储到嵌套键。有没有其他方法可以实现这一点?
我有一个带有两个容器的 Pod。
\n\napiVersion: v1\nkind: Pod\nmetadata:\n name: test\nspec:\n containers:\n - name: my-container\n image: google/my-container:v1\n - name: third-party\n image: google/third-party:v1\nRun Code Online (Sandbox Code Playgroud)\n\n第一个容器是我的映像,第二个容器是第三方映像,我可以\xe2\x80\x99t 控制其标准输出/标准错误。
\n我需要 my-container 能够访问第三方容器中写入的日志。
\n在“my-container”内部,我想从“第三方”容器收集所有 stdout 和 stderr,添加一些元数据并用我的记录器写入它。
我无法将特权容器与volumeMounts一起使用。
\n\n如果我能做这样的事情那就太好了。
\n\n containers:\n - name: my-container\n image: google/my-container:v1\n volumeMounts:\n - name: varlog\n mountPath: /var/log\n\n - name: third-party\n image: google/third-party:v1 \n stdout: /var/log/stdout\n stderr: /var/log/stderr\n\n volumes:\n - name: varlog\n emptyDir: {}\n\nRun Code Online (Sandbox Code Playgroud)\n 我在 k8s 中有一个相当简单的 Apache 部署,使用 Fluent-bit v1.5 作为日志转发器。我的设置与下面存储库中的设置几乎相同。我正在运行 AWS EKS 并将日志输出到 AWS ElasticSearch Service。
https://github.com/ Fluent/ Fluent-bit-kubernetes-logging
ConfigMap 位于: https: //github.com/ Fluent/ Fluent-bit-kubernetes-logging/blob/master/output/elasticsearch/ Fluent-bit-configmap.yaml
Apache 访问 (-> /dev/stdout) 和错误 (-> /dev/stderr) 日志行均位于节点上的同一容器日志文件中。我遇到的问题是 fluid-bit 似乎无法自动检测要使用哪个解析器,我不确定它是否应该这样做,而且我们只能在部署的注释部分指定一个解析器,我已经指定了 apache 。因此,最终,写入同一文件但来自 stderr 的错误日志行不会被解析。我应该将日志从 Fluent-bit 发送到 Fluentd 来处理错误文件(假设 Fluentd 可以处理这个问题),还是应该以某种方式仅将错误行抽回到 Fluent-Bit 中进行解析?
我错过了什么吗?
谢谢!
我想通过 docker compose 构建 efk 记录器系统。\n一切都已设置,只有 fluidd 有问题。
\nfluidd docker 容器日志
\n\n\n2022-02-15 02:06:11 +0000 [info]:解析配置文件成功path =“/ Fluentd/etc/ Fluent.conf”
\n
\n\n2022-02-15 02:06:11 +0000 [信息]: gem 'fluid-plugin-elasticsearch' 版本 '5.0.3'
\n
\n\n2022-02-15 02:06:11 +0000 [信息]: gem 'fluidd' 版本 '1.12.0'
\n
\n\n/usr/local/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': 无法加载此类文件 -- elasticsearch/transport/transport/connections/selector (LoadError)
\n
我的目录:
\n 我的项目/\n \xe2\x94\x9c\xe2\x94\x80 fluidd/\n \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 conf/\n \xe2\x94\ x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 Fluent.conf\n \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2 \x94\x80 Dockerfile\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 docker-compose.yml\n\n
docker-compose.yml:
\nversion: "3"\nservices:\n web:\n …Run Code Online (Sandbox Code Playgroud) fluentd ×10
logging ×3
fluent-bit ×2
kibana ×2
android ×1
docker ×1
efk ×1
json ×1
kubernetes ×1
monitoring ×1
openshift ×1
plugins ×1