From e244d4470179df2eb3e85be88a79bf5016c879c9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 15 Jun 2021 16:20:29 -0400 Subject: [PATCH] Osquerybeat: Align with the rest of the beats, set the ECS version (#26324) (#26332) (cherry picked from commit 8c810f9d84be8a1edaa66bffd078c54ddcef2a86) Co-authored-by: Aleksandr Maus --- x-pack/osquerybeat/cmd/root.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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)