Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonQ committed Jan 10, 2024
1 parent a8db043 commit a9ed626
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 0 additions & 2 deletions libbeat/cmd/instance/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ func Run(settings Settings, bt beat.Creator) error {

// NewInitializedBeat creates a new beat where all information and initialization is derived from settings
func NewInitializedBeat(settings Settings) (*Beat, error) {
// anderson: could we read os.Stdin here? then we could parse the version
// and propagate it
b, err := NewBeat(settings.Name, settings.IndexPrefix, settings.Version, settings.ElasticLicensed)
if err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions libbeat/publisher/processing/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func MakeDefaultSupport(
if fleetmode.Enabled() && !beatCfg.HasField("processors") {
log.Debugf("In fleet mode with no processors specified, defaulting to global processors")
rawProcessors = fleetDefaultProcessors

} else {
rawProcessors = cfg.Processors
}
Expand Down
8 changes: 5 additions & 3 deletions libbeat/version/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ import "time"

// GetDefaultVersion returns the current libbeat version.
// This method is in a separate file as the version.go file is auto generated
// TODO(AndersonQ): does it need to be changed? in the agent's code there is still a GetDefaultVersion
// with the same behaviour as this one and it's used in several place. And there
// is another function for the package version.
//
// TODO(AndersonQ): does it need to be changed? in the agent's code there is
// still a GetDefaultVersion with the same behaviour as this one and it's used
// in several places. Also, in the agent code, there is another function for
// getting the package version.
func GetDefaultVersion() string {
if qualifier == "" {
return defaultBeatVersion
Expand Down
6 changes: 1 addition & 5 deletions x-pack/libbeat/management/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/elastic/elastic-agent-client/v7/pkg/client"
"github.com/elastic/elastic-agent-client/v7/pkg/proto"
conf "github.com/elastic/elastic-agent-libs/config"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/elastic-agent-libs/mapstr"
)

Expand Down Expand Up @@ -167,7 +166,7 @@ func CreateReloadConfigFromInputs(raw []map[string]interface{}) ([]*reload.Confi
// config injection
// ===========

// convenience method for wrapping all the stream transformations needed by the shipper and other inputs
// convinence method for wrapping all the stream transformations needed by the shipper and other inputs
func createStreamRules(raw *proto.UnitExpectedConfig, streamSource map[string]interface{}, stream *proto.Stream, defaultDataStreamType string, agentInfo *client.AgentInfo, defaultProcessors ...mapstr.M) (map[string]interface{}, error) {

streamSource = injectIndexStream(defaultDataStreamType, raw, stream, streamSource)
Expand Down Expand Up @@ -210,9 +209,6 @@ func injectAgentInfoRule(inputs map[string]interface{}, agentInfo *client.AgentI
}
var processors []interface{}

logp.NewLogger("anderson").Infow("injectAgentInfoRule agentInfo",
"agent_info", *agentInfo)

processors = append(processors, generateAddFieldsProcessor(
mapstr.M{"id": agentInfo.ID, "snapshot": agentInfo.Snapshot, "version": agentInfo.Version},
"elastic_agent"))
Expand Down

0 comments on commit a9ed626

Please sign in to comment.