From 9ec186332a9f98d295477b1262772412c1a7e659 Mon Sep 17 00:00:00 2001 From: Aleksandr Maus Date: Tue, 15 Jun 2021 15:12:58 -0400 Subject: [PATCH] Osquerybeat: Align with the rest of the beats, set the ECS version (#26324) (cherry picked from commit 8c810f9d84be8a1edaa66bffd078c54ddcef2a86) # Conflicts: # x-pack/osquerybeat/cmd/root.go --- x-pack/osquerybeat/cmd/root.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/x-pack/osquerybeat/cmd/root.go b/x-pack/osquerybeat/cmd/root.go index adaa112619f..441811a48a8 100644 --- a/x-pack/osquerybeat/cmd/root.go +++ b/x-pack/osquerybeat/cmd/root.go @@ -9,17 +9,37 @@ import ( cmd "github.com/elastic/beats/v7/libbeat/cmd" "github.com/elastic/beats/v7/libbeat/cmd/instance" +<<<<<<< HEAD xpackcmd "github.com/elastic/beats/v7/x-pack/libbeat/cmd" +======= + "github.com/elastic/beats/v7/libbeat/common" + "github.com/elastic/beats/v7/libbeat/publisher/processing" + + _ "github.com/elastic/beats/v7/x-pack/libbeat/include" +>>>>>>> 8c810f9d8 (Osquerybeat: Align with the rest of the beats, set the ECS version (#26324)) ) // 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)