【问题标题】:Converting string to float in Fluentd在 Fluentd 中将字符串转换为浮点数
【发布时间】:2018-09-13 05:48:32
【问题描述】:

在过去的两天里,我一直在为这个看似简单的任务而头晕目眩……我是 Fluentd 的新手。 数据采用 JSON 格式,具有完美的键值形式。我使用 td-agent3。

{"key1":"value1","key2":"number_in_string"}

#td-agent.conf
<source>
  @type tcp
  port 24224
  tag test
  bind 0.0.0.0
  <parse>
    @type json
    types key2:float
  </parse>
</source>

<match **>
  @type copy
  #store locally
  <store>
    @type file
    path /var/log/td-agent/test.log
  </store>
</match>

我得到模式不匹配结果。

谢谢!

【问题讨论】:

    标签: fluentd


    【解决方案1】:

    我完全放弃了我原来的方法。我正在使用 fluent-plugin-filter_typecast 代替。这行得通!

    【讨论】:

      猜你喜欢
      • 2011-11-25
      • 1970-01-01
      • 2014-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-21
      相关资源
      最近更新 更多