Skip to content

Commit

Permalink
Handle missing key case gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed May 13, 2020
1 parent 5c02b87 commit 0a7e6b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libbeat/outputs/elasticsearch/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ func createEventBulkMeta(
func getPipeline(event *beat.Event, pipelineSel *outil.Selector) (string, error) {
if event.Meta != nil {
pipeline, err := events.GetMetaStringValue(*event, events.FieldMetaPipeline)
if err == common.ErrKeyNotFound {
return "", nil
}
if err != nil {
return "", errors.New("pipeline metadata is no string")
}
Expand Down

0 comments on commit 0a7e6b5

Please sign in to comment.