Skip to content

Commit

Permalink
Debug empty root field instead of error (elastic#24966)
Browse files Browse the repository at this point in the history
(cherry picked from commit ead29fc)
  • Loading branch information
marc-gr committed Apr 7, 2021
1 parent 5ae6529 commit a7f311b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions x-pack/filebeat/input/httpjson/internal/v2/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,20 @@ func (rp *responseProcessor) startProcessing(stdCtx context.Context, trCtx *tran
}

if err := rp.split.run(trCtx, tr, ch); err != nil {
if err == errEmptyField {
switch err {
case errEmptyField:
// nothing else to send for this page
rp.log.Debug("split operation finished")
continue
case errEmptyRootField:
// root field not found, most likely the response is empty
rp.log.Debug(err)
return
default:
rp.log.Debug("split operation failed")
ch <- maybeMsg{err: err}
return
}
rp.log.Debug("split operation failed")
ch <- maybeMsg{err: err}
return
}
}
}
Expand Down

0 comments on commit a7f311b

Please sign in to comment.