Skip to content

Commit

Permalink
Cherry-pick #11549 to 7.0: Fix issue 11543 when key 'log' does not ex…
Browse files Browse the repository at this point in the history
…ist (#11553)

* Fix panic in add_kubernetes_metadata processor when key `log` does not exist. {issue}11543[11543]

(cherry picked from commit aba44a8)
  • Loading branch information
Ray Qiu committed Mar 30, 2019
1 parent 393c313 commit 250c2dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Expand Up @@ -42,6 +42,7 @@ https://github.com/elastic/beats/compare/v7.0.0-rc1...master[Check the HEAD diff
*Filebeat*

- Don't apply multiline rules in Logstash json logs. {pull}11346[11346]
- Fix panic in add_kubernetes_metadata processor when key `log` does not exist. {issue}11543[11543] {pull}11549[11549]

*Heartbeat*

Expand Down
3 changes: 2 additions & 1 deletion filebeat/processor/add_kubernetes_metadata/matchers.go
Expand Up @@ -77,7 +77,8 @@ const containerIdLen = 64
const podUIDPos = 5

func (f *LogPathMatcher) MetadataIndex(event common.MapStr) string {
if value, ok := event["log"].(common.MapStr)["file"].(common.MapStr)["path"]; ok {
value, err := event.GetValue("log.file.path")
if err == nil {
source := value.(string)
logp.Debug("kubernetes", "Incoming log.file.path value: %s", source)

Expand Down

0 comments on commit 250c2dd

Please sign in to comment.