Skip to content

Commit

Permalink
Merge pull request #645 from ruflin/remove-filebeat-exit
Browse files Browse the repository at this point in the history
Remove exits from filebeat
  • Loading branch information
andrewkroh committed Jan 6, 2016
2 parents ce1ffd4 + 5deb914 commit 9e573c9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ https://github.com/elastic/beats/compare/1.0.0...master[Check the HEAD diff]

*Filebeat*
- Add exclude_files configuration option {pull}563[563]
- Stop filebeat if filebeat is started without any prospectors defined {pull}644[644]

*Winlogbeat*

Expand Down
11 changes: 0 additions & 11 deletions filebeat/beat/filebeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package beat

import (
"fmt"
"os"

"github.com/elastic/beats/libbeat/beat"
"github.com/elastic/beats/libbeat/cfgfile"
Expand Down Expand Up @@ -50,16 +49,6 @@ func (fb *Filebeat) Setup(b *beat.Beat) error {

func (fb *Filebeat) Run(b *beat.Beat) error {

defer func() {
p := recover()
if p == nil {
return
}

fmt.Printf("recovered panic: %v", p)
os.Exit(1)
}()

var err error

// Init channels
Expand Down
5 changes: 1 addition & 4 deletions filebeat/crawler/crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package crawler

import (
"fmt"
"os"

"github.com/elastic/beats/filebeat/config"
"github.com/elastic/beats/filebeat/input"
Expand Down Expand Up @@ -48,9 +47,7 @@ func (crawler *Crawler) Start(prospectorConfigs []config.ProspectorConfig, event

err := prospector.Init()
if err != nil {
logp.Critical("Error in initing prospector: %s", err)
fmt.Printf("Error in initing prospector: %s", err)
os.Exit(1)
return fmt.Errorf("Error in initing prospector: %s", err)
}

go prospector.Run(eventChan)
Expand Down
2 changes: 1 addition & 1 deletion libbeat/beat/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (b *Beat) Run() {
// Run beater specific stuff
err = b.BT.Run(b)
if err != nil {
logp.Critical("Run returned an error: %v", err)
logp.Critical("Running the beat returned an error: %v", err)
}

service.Cleanup()
Expand Down

0 comments on commit 9e573c9

Please sign in to comment.