-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt packetbeat structure to newest libbeat structure
Update to most recent libbeat version
- Loading branch information
Showing
5 changed files
with
67 additions
and
71 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
Godeps/_workspace/src/github.com/elastic/libbeat/beat/beat.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
Godeps/_workspace/src/github.com/elastic/libbeat/outputs/logstash/client.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,16 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
packetbeat "github.com/elastic/packetbeat/beat" | ||
|
||
"github.com/elastic/libbeat/beat" | ||
"github.com/elastic/libbeat/logp" | ||
) | ||
|
||
// You can overwrite these, e.g.: go build -ldflags "-X main.Version 1.0.0-beta3" | ||
var Version = "1.0.0" | ||
var Name = "packetbeat" | ||
|
||
// Setups and Runs Packetbeat | ||
func main() { | ||
|
||
// Create Beater object | ||
pb := &Packetbeat{} | ||
|
||
// Initi beat objectefile | ||
b := beat.NewBeat(Name, Version, pb) | ||
|
||
// Additional command line args are used to overwrite config options | ||
pb.CmdLineArgs = fetchAdditionalCmdLineArgs() | ||
|
||
// Base CLI flags | ||
b.CommandLineSetup() | ||
|
||
// Beat CLI flags | ||
pb.CliFlags(b) | ||
|
||
// Loads base config | ||
b.LoadConfig() | ||
|
||
// Configures beat | ||
err := pb.Config(b) | ||
if err != nil { | ||
logp.Critical("Config error: %v", err) | ||
os.Exit(1) | ||
} | ||
|
||
// Run beat. This calls first beater.Setup, | ||
// then beater.Run and beater.Cleanup in the end | ||
b.Run() | ||
beat.Run(Name, Version, packetbeat.New()) | ||
} |