Skip to content

Commit

Permalink
LOGGING-2546: Support for multiple entity.guid in the Log Forwarder (#41
Browse files Browse the repository at this point in the history
)

[LOGGING-2546] Adds support for multiple entity.guid in the Log Forwarder by using a differentiated key for the entity.guid introduced by the Infrastructure Agent
  • Loading branch information
jsubirat authored Jul 16, 2020
1 parent 21db40d commit 3394abd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pkg/integrations/v4/logs/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (
)

const (
rAttEntityGUID = "entity.guid"
rAttEntityGUID = "entity.guid.INFRA"
rAttFbInput = "fb.input"
rAttPluginType = "plugin.type"
rAttHostname = "hostname"
Expand Down
24 changes: 12 additions & 12 deletions pkg/integrations/v4/logs/cfg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ func TestNewFBConf(t *testing.T) {
Name: "record_modifier",
Match: "*",
Records: map[string]string{
"entity.guid": "0",
"plugin.type": "nri-agent",
"hostname": "",
"entity.guid.INFRA": "0",
"plugin.type": "nri-agent",
"hostname": "",
},
}
inputRecordModifier := func(i string, m string) FBCfgParser {
Expand Down Expand Up @@ -229,8 +229,8 @@ func TestNewFBConf(t *testing.T) {
Name: "reserved-test",
File: "/foo/file.foo",
Attributes: map[string]string{
"valid": "value",
"entity.guid": "should-be-ignored",
"valid": "value",
"entity.guid.INFRA": "should-be-ignored",
},
},
}, FBCfg{
Expand Down Expand Up @@ -728,7 +728,7 @@ func TestFBCfgFormat(t *testing.T) {
[FILTER]
Name record_modifier
Match *
Record entity.guid testGUID
Record entity.guid.INFRA testGUID
Record fb.source nri-agent
[OUTPUT]
Expand Down Expand Up @@ -803,8 +803,8 @@ func TestFBCfgFormat(t *testing.T) {
Name: "record_modifier",
Match: "*",
Records: map[string]string{
"entity.guid": "testGUID",
"fb.source": "nri-agent",
"entity.guid.INFRA": "testGUID",
"fb.source": "nri-agent",
},
},
},
Expand Down Expand Up @@ -843,7 +843,7 @@ func TestFBCfgFormatWithHostname(t *testing.T) {
[FILTER]
Name record_modifier
Match *
Record entity.guid testGUID
Record entity.guid.INFRA testGUID
Record hostname ubuntu
Record plugin.type nri-agent
Expand Down Expand Up @@ -893,9 +893,9 @@ func TestFBCfgFormatWithHostname(t *testing.T) {
Name: "record_modifier",
Match: "*",
Records: map[string]string{
"entity.guid": "testGUID",
"plugin.type": "nri-agent",
"hostname": "ubuntu",
"entity.guid.INFRA": "testGUID",
"plugin.type": "nri-agent",
"hostname": "ubuntu",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions pkg/integrations/v4/logs/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ var (
Name: "record_modifier",
Match: "*",
Records: map[string]string{
"entity.guid": "FOOBAR",
"plugin.type": logRecordModifierSource,
"hostname": hostName,
"entity.guid.INFRA": "FOOBAR",
"plugin.type": logRecordModifierSource,
"hostname": hostName,
}, // see idnProvide below
}
idnProvide = func() entity.Identity {
Expand Down

0 comments on commit 3394abd

Please sign in to comment.