diff --git a/pkg/reporting/exporters/es/elasticsearch.go b/pkg/reporting/exporters/es/elasticsearch.go index 68fb64e7e5..7b627492c9 100644 --- a/pkg/reporting/exporters/es/elasticsearch.go +++ b/pkg/reporting/exporters/es/elasticsearch.go @@ -131,7 +131,8 @@ func (exporter *Exporter) Export(event *output.ResultEvent) error { if err != nil { return err } - + defer res.Body.Close() + b, err = io.ReadAll(res.Body) if err != nil { return errors.New(err.Error() + "error thrown by elasticsearch " + string(b))