Hi All,
I am planning to use out_http plugin to implement a failover scenario. The idea is to use Fluentd to post application/json type message to a http endpoint (which is basically a rest API).
But the issue here is Fluentd supports only application/x-ndjson (new line delimited JSON format) and this is not supported by target API and the error logged is -
fluent.warn: {"error":"#<Fluent::UnrecoverableError: 415 Unsupported Media Type{\"timestamp\":1583475757779,\"status\":415,\"error\":\"Unsupported Media Type\",\"exception\":\"org.springframework.web.HttpMediaTypeNotSupportedException\",\"message\":\"Content type 'application/x-ndjson;charset=UTF-8' not supported\",\"path\":\"/api/watchproducer/v1.0\"}
Example match case I used as below:-
<match payloadtraffic.**>
@type http
endpoint http://12345.abcd.com/api/watchproducer/v1.0
open_timeout 2
<format>
@type json
add_newline false
</format>
<buffer>
@type file
path "/fluentd/buffers/#{ENV["HOSTNAME"]}/payloadtrafficdev.buffer"
flush_interval 10s
</buffer>
</match>
Is there a way I can send JSON payload to a http endpoint using out_http plugin