fix(outputs.elasticsearch): Print error status value (#14115)

This commit is contained in:
Joshua Powers 2023-10-31 08:55:39 -06:00 committed by GitHub
parent 3b2d8c507f
commit 446fb9d64e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -316,8 +316,9 @@ func (a *Elasticsearch) Write(metrics []telegraf.Metric) error {
if res.Errors {
for id, err := range res.Failed() {
a.Log.Errorf(
"Elasticsearch indexing failure, id: %d, error: %s, caused by: %s, %s",
"Elasticsearch indexing failure, id: %d, status: %d, error: %s, caused by: %s, %s",
id,
err.Status,
err.Error.Reason,
err.Error.CausedBy["reason"],
err.Error.CausedBy["type"],