@@ -198,6 +198,11 @@ type Config struct {
198198 // >
199199 // > The name of the ingest pipeline to write events to.
200200 IngestPipeline string `json:"ingest_pipeline"` // *
201+
202+ // > @3@4@5@6
203+ // >
204+ // > Process ES response and report errors, if any.
205+ ProcessResponse bool `json:"process_response" default:"true"` // *
201206}
202207
203208type KeepAliveConfig struct {
@@ -411,12 +416,17 @@ func (p *Plugin) out(workerData *pipeline.WorkerData, batch *pipeline.Batch) err
411416}
412417
413418func (p * Plugin ) send (data []byte ) (int , error ) {
419+ processFn := p .reportESErrors
420+ if ! p .config .ProcessResponse {
421+ processFn = nil
422+ }
423+
414424 return p .client .DoTimeout (
415425 http .MethodPost ,
416426 NDJSONContentType ,
417427 data ,
418428 p .config .ConnectionTimeout_ ,
419- p . reportESErrors ,
429+ processFn ,
420430 )
421431}
422432
@@ -425,11 +435,18 @@ func (p *Plugin) sendSplit(left int, right int, begin []int, data []byte) (int,
425435 return http .StatusOK , nil
426436 }
427437
438+ processFn := p .reportESErrors
439+ if ! p .config .ProcessResponse {
440+ processFn = nil
441+ }
442+
428443 statusCode , err := p .client .DoTimeout (
429444 http .MethodPost ,
430445 NDJSONContentType ,
431446 data [begin [left ]:begin [right ]],
432- p .config .ConnectionTimeout_ , p .reportESErrors )
447+ p .config .ConnectionTimeout_ ,
448+ processFn ,
449+ )
433450
434451 if err != nil {
435452 p .sendErrorMetric .WithLabelValues (strconv .Itoa (statusCode )).Inc ()
0 commit comments