【问题标题】:How to extract fields from kubernetes app logs - efk stack如何从 kubernetes 应用程序日志中提取字段 -​​ efk 堆栈
【发布时间】:2020-01-14 15:40:19
【问题描述】:

我正在使用 FluentD(部署为 DaemonSet)将 k8s 应用程序(容器)日志流式传输到 elasticsearch。 我想从弹性的'log'键字符串中提取特定键,例如logKey:...或statusCode:..(在下面的'log'键内)

Please see the log i'm trying to parse:

我看到我应该使用 FluentD 插件在将日志发送到弹性之前对其进行解析, 但不幸的是我没有找到办法。

这是我当前的 ConfigMap 容器部分:

<source>
  @type tail
  path /var/log/containers/*.log
  pos_file /var/log/app.log.pos
  tag kubernetes.*
  read_from_head true
  <parse>
    @type json
    time_format %Y-%m-%dT%H:%M:%S.%NZ
  </parse>
</source>

非常感谢您的帮助。

【问题讨论】:

    标签: elasticsearch kubernetes fluentd


    【解决方案1】:

    你在尝试this 插件吗?
    fluentd的配置好像已经设置好了。
    https://github.com/kubernetes/kubernetes/blob/8568d1843daababe70763b30ae897388710b2216/cluster/addons/fluentd-elasticsearch/fluentd-es-configmap.yaml

    你的 ConfigMap 是否附加到上面的 ConfigMap 中?

    【讨论】:

    • 是的,但我没有设法理解如何解析和提取它。
    猜你喜欢
    • 2021-01-10
    • 2020-06-16
    • 2020-01-26
    • 2019-04-06
    • 1970-01-01
    • 1970-01-01
    • 2020-10-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多