diff --git a/x-pack/osquerybeat/cmd/root.go b/x-pack/osquerybeat/cmd/root.go index c4548bac200..9ac13d1c1ed 100644 --- a/x-pack/osquerybeat/cmd/root.go +++ b/x-pack/osquerybeat/cmd/root.go @@ -9,18 +9,33 @@ import ( cmd "github.com/elastic/beats/v7/libbeat/cmd" "github.com/elastic/beats/v7/libbeat/cmd/instance" + "github.com/elastic/beats/v7/libbeat/common" + "github.com/elastic/beats/v7/libbeat/publisher/processing" _ "github.com/elastic/beats/v7/x-pack/libbeat/include" ) // Name of this beat -var Name = "osquerybeat" +const ( + Name = "osquerybeat" + + // ecsVersion specifies the version of ECS that this beat is implementing. + ecsVersion = "1.10.0" +) + +// withECSVersion is a modifier that adds ecs.version to events. +var withECSVersion = processing.WithFields(common.MapStr{ + "ecs": common.MapStr{ + "version": ecsVersion, + }, +}) var RootCmd = Osquerybeat() func Osquerybeat() *cmd.BeatsRootCmd { settings := instance.Settings{ Name: Name, + Processing: processing.MakeDefaultSupport(true, withECSVersion, processing.WithAgentMeta()), ElasticLicensed: true, } command := cmd.GenRootCmdWithSettings(beater.New, settings)