【问题标题】:Google Fluentd Decode Base64Google Fluentd 解码 Base64
【发布时间】:2020-12-16 06:57:35
【问题描述】:

我有记录在两个标签RecordStartRecordEnd 之间的日志文件记录的消息是base64 编码我想使用google-fluentd 解码消息,因此它可以发送到其他服务。 我的配置:

<source>
  @type tail
  path <path_ot>/metrics.log
  pos_file /var/lib/google-fluentd/pos/metrics.pos
  read_from_head true
  format  multiline
  multiline_flush_interval 2s
  format_firstline /^RecordStart/
  format1 /^RecordStart\n(?<record>(\n|.)*)RecordEnd$/
  tag presto_server
</source>

我不知道如何解码 base64 有什么帮助吗?

【问题讨论】:

    标签: google-cloud-platform fluentd


    【解决方案1】:

    尝试使用filter plugindecode base64 文件。

    在这种情况下,您的配置文件可能如下所示:

    <source>
      @type tail
      path <path_ot>/metrics.log
      pos_file /var/lib/google-fluentd/pos/metrics.pos
      read_from_head true
      format  multiline
      multiline_flush_interval 2s
      format_firstline /^RecordStart/
      format1 /^RecordStart\n(?<record>(\n|.)*)RecordEnd$/
      tag presto_server
    </source>
    
    <filter presto_server>
      type base64_decode
      fields mesg
    </filter>
    

    这是对我找到的配置文件here的改编。

    您也可能会发现此文档很有帮助:HYow to modify log recordsfluentd 摄取。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-29
      • 2023-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-14
      相关资源
      最近更新 更多