-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Check CONTRIBUTING guideline first and here is the list to help us investigate the problem.
Is your feature request related to a problem? Please describe.
I have 2 managed k8s clusters with individual fluentd services and want to forward some logs from cluster_1 to cluster_2. I can't use the forward protocol because the ingress does not allow raw TCP forwarding.
Instead I tried to use out_http in cluster_1 and in_http in cluster_2, since HTTP based ingress configurations are easy to do. But I couldn't find a working configuration, all failed with one of:
400 Bad Request\nReceived event is not json400 Bad Request\n'json' or 'msgpack' parameter is required- Server:
incoming event is invalid: path=/some.tag params={"json":"{\"hello\":\"world\",\"num\":18}\n{\"hello\":\"world\",\"num\":19}\n",...}
Describe the solution you'd like
There should be an easy configuration to allow using http to forward events between 2 fluentd instances.
I see 2 possible solutions:
- add an option to
out_httpto optionally wrap (json) events in an (json) array - add an option to
in_http/parse_jsonto be able to handle the json lines format used byout_http
Describe alternatives you've considered
Declare the out_http -> in_http case to be out of scope. In that case there should be some mention of it in the docs, to save the next person time. Two plugins which communicate over HTTP but can't talk to one another is very counter-intuitive in my opinion.
Additional context
Configuration for reproducing the problem.
# sending side
<source>
@type dummy
dummy {"hello":"world"}
auto_increment_key num
tag kube.test.tag
</source>
<match **>
@type http
endpoint http://localhost:9881/$tag
open_timeout 2
#content_type application/json #results in 'invalid event' if uncommented
<format>
@type json
</format>
<buffer>
flush_interval 2s
</buffer>
</match>
# receiving side
<source>
@type http
port 9881
bind 0.0.0.0
<parse> # comment out for 'json parameter required'
@type json
</parse>
</source>
<match **>
@type stdout
</match>