diff --git a/plugins/out_http/http.c b/plugins/out_http/http.c index d804b7734f6..17840975309 100644 --- a/plugins/out_http/http.c +++ b/plugins/out_http/http.c @@ -178,7 +178,6 @@ static int http_post(struct flb_out_http *ctx, } else if ((ctx->out_format == FLB_PACK_JSON_FORMAT_JSON) || (ctx->out_format == FLB_PACK_JSON_FORMAT_STREAM) || - (ctx->out_format == FLB_PACK_JSON_FORMAT_LINES) || (ctx->out_format == FLB_HTTP_OUT_GELF)) { flb_http_add_header(c, FLB_HTTP_CONTENT_TYPE, @@ -186,6 +185,13 @@ static int http_post(struct flb_out_http *ctx, FLB_HTTP_MIME_JSON, sizeof(FLB_HTTP_MIME_JSON) - 1); } + else if ((ctx->out_format == FLB_PACK_JSON_FORMAT_LINES)) { + flb_http_add_header(c, + FLB_HTTP_CONTENT_TYPE, + sizeof(FLB_HTTP_CONTENT_TYPE) - 1, + FLB_HTTP_MIME_NDJSON, + sizeof(FLB_HTTP_MIME_NDJSON) - 1); + } else if ((ctx->out_format == FLB_HTTP_OUT_MSGPACK)) { flb_http_add_header(c, FLB_HTTP_CONTENT_TYPE, diff --git a/plugins/out_http/http.h b/plugins/out_http/http.h index 585e51cb40f..ba588ac90ca 100644 --- a/plugins/out_http/http.h +++ b/plugins/out_http/http.h @@ -26,6 +26,7 @@ #define FLB_HTTP_CONTENT_TYPE "Content-Type" #define FLB_HTTP_MIME_MSGPACK "application/msgpack" #define FLB_HTTP_MIME_JSON "application/json" +#define FLB_HTTP_MIME_NDJSON "application/x-ndjson" #ifdef FLB_HAVE_SIGNV4 #ifdef FLB_HAVE_AWS