Skip to content

Commit

Permalink
Fix issue 11543 when key 'log' does not exist (elastic#11549)
Browse files Browse the repository at this point in the history
* 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 authored and andrewkroh committed Mar 30, 2019
1 parent 393c313 commit eb11ece
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.next.asciidoc
Expand Up @@ -42,6 +42,8 @@ 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 coredns image in docs.asciidoc for docs build. {pull}11460[11460] {pull}11461[11461]
- 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 eb11ece

Please sign in to comment.