我想删除添加到fluentD转发消息的其他元数据

时间:2019-01-21 17:22:28

标签: fluentd

我正在将td-agent脚本中的json消息转发到fluentD服务器,fluentD转发器正在向原始json消息中添加<timestamp> <tag>:

原始讯息:

{"datetime":"2019-01-22 02:00:44.859","request_ip":"127.0.0.1","response_code":"200","response_time":334}

在fluentD服务器上收到:

2019-01-22 02:00:44.000000000 +0900 ts.reformed.casted: {"datetime":"2019-01-22 02:00:44.859","request_ip":"127.0.0.1","response_code":"200","response_time":334}

我如何从以上消息中删除2019-01-22 02:00:44.000000000 +0900 ts.reformed.casted:

//this forwarder
<match ts.reformed.casted>
    type forward
    <server>
      name fluentdforwarder
      host 127.0.0.1
      port 24224
      weight 60
    </server>
    dns_round_robin true
    require_ack_response true
    heartbeat_type none
    required_acks       0
    format json
    ack_response_timeout      1500
</match>

//on fluentD server
<source>
  @type forward
  port 24224
  bind 0.0.0.0
  format json
  skip_invalid_event true
</source>
<match ts.reformed.casted>
  @type stdout
</match>

0 个答案:

没有答案