From 0a7e6b5b67152812c4b98f15a84cb4d8f0ed8a11 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Wed, 13 May 2020 11:24:46 -0700 Subject: [PATCH] Handle missing key case gracefully --- libbeat/outputs/elasticsearch/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libbeat/outputs/elasticsearch/client.go b/libbeat/outputs/elasticsearch/client.go index b88a15cda68..4a3c71df3bf 100644 --- a/libbeat/outputs/elasticsearch/client.go +++ b/libbeat/outputs/elasticsearch/client.go @@ -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") }