go-elasticsearch icon indicating copy to clipboard operation
go-elasticsearch copied to clipboard

Can not log request body if CompressRequestBody enabled in Client

Open m-chrome opened this issue 4 months ago • 0 comments

Version

github.com/elastic/go-elasticsearch/v8 v8.15.0

Elasticsearch version: 8.2.2

Description

If client option CompressRequestBody is enabled, request body becomes empty in logger request here, because it already read in gzip compressor. Is it bug or normal behavior?

How to reproduce

  1. Implement interface Logger from elastictransport, where RequestBodyEnabled returns true
  2. Enable client option CompressRequestBody
  3. Set logger from step 1 in client
  4. Perform client.Bulk with some not empty body and see empty request body in logger from step 1

m-chrome avatar Oct 21 '24 11:10 m-chrome