Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metricbeat filters cause panic when removing events #4327

Closed
tsg opened this issue May 16, 2017 · 1 comment
Closed

Metricbeat filters cause panic when removing events #4327

tsg opened this issue May 16, 2017 · 1 comment
Labels

Comments

@tsg
Copy link
Contributor

tsg commented May 16, 2017

  • Version: master
  • Operating System: darwin

Starting metricbeat master with this config:

metricbeat.modules:
- module: system
  enabled: true
  period: 1m
  metricsets:
    - filesystem
  filters:
    - drop_event.when.regexp.mount_point: '^/(sys|cgroup|proc|dev|etc|host|lib)($|/)'

output.elasticsearch.hosts: ["localhost:9200"]

Causes a panic in the master branch:

2017/05/16 12:35:21.928875 beat.go:262: INFO metricbeat start running.
panic: assignment to entry in nil map

goroutine 53 [running]:
github.com/elastic/beats/libbeat/publisher.(*client).annotateEvent(0xc42031b140, 0x0)
	/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/client.go:180 +0xe0
github.com/elastic/beats/libbeat/publisher.(*client).PublishEvent(0xc42031b140, 0x0, 0x0, 0x0, 0x0, 0x1)
	/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/client.go:99 +0x50
github.com/elastic/beats/metricbeat/mb/module.PublishChannels.func1(0xc420318c00)
	/Users/tsg/src/github.com/elastic/beats/metricbeat/mb/module/publish.go:25 +0xd4
created by github.com/elastic/beats/metricbeat/mb/module.PublishChannels
	/Users/tsg/src/github.com/elastic/beats/metricbeat/mb/module/publish.go:32 +0xec

But works with 5.4.1

The issue seems related to the filter, which results in a nil event.

@tsg tsg added bug Metricbeat Metricbeat labels May 16, 2017
@andrewkroh
Copy link
Member

We used to have nil checks at

if event != nil {
rtnEvents = append(rtnEvents, event)
}
. But I forgot to put them back in while refactoring.

tsg pushed a commit to tsg/beats that referenced this issue May 16, 2017
`nil` can happen if the event is dropped by processors. Fixes elastic#4327.
ruflin pushed a commit that referenced this issue May 17, 2017
`nil` can happen if the event is dropped by processors. Fixes #4327.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants