diff --git a/test/fakeintake/aggregator/fixtures/log_bytes b/test/fakeintake/aggregator/fixtures/log_bytes index 5fb4999ee7569..d23c6a5c1c091 100644 Binary files a/test/fakeintake/aggregator/fixtures/log_bytes and b/test/fakeintake/aggregator/fixtures/log_bytes differ diff --git a/test/fakeintake/aggregator/logAggregator.go b/test/fakeintake/aggregator/logAggregator.go index 7d2fb113d70d3..1d03ec96cfb11 100644 --- a/test/fakeintake/aggregator/logAggregator.go +++ b/test/fakeintake/aggregator/logAggregator.go @@ -8,20 +8,36 @@ package aggregator import ( "bytes" "encoding/json" + "strings" "time" "github.com/DataDog/datadog-agent/test/fakeintake/api" ) +type tags []string + type Log struct { collectedTime time.Time - Message string `json:"message"` - Status string `json:"status"` - Timestamp int `json:"timestamp"` - HostName string `json:"hostname"` - Service string `json:"service"` - Source string `json:"source"` - Tags []string `json:"tags"` + Message string `json:"message"` + Status string `json:"status"` + Timestamp int `json:"timestamp"` + HostName string `json:"hostname"` + Service string `json:"service"` + Source string `json:"ddsource"` + Tags tags `json:"ddtags"` +} + +func (t *tags) UnmarshalJSON(b []byte) error { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + *t = tags(strings.Split(s, ",")) + return nil +} + +func (t tags) MarshalJSON() ([]byte, error) { + return json.Marshal(strings.Join(t, ",")) } func (l *Log) name() string { diff --git a/test/fakeintake/server/fixture_test/log_bytes b/test/fakeintake/server/fixture_test/log_bytes index 5fb4999ee7569..d23c6a5c1c091 100644 Binary files a/test/fakeintake/server/fixture_test/log_bytes and b/test/fakeintake/server/fixture_test/log_bytes differ diff --git a/test/fakeintake/server/server_test.go b/test/fakeintake/server/server_test.go index daa51e73b7089..82e36c939575c 100644 --- a/test/fakeintake/server/server_test.go +++ b/test/fakeintake/server/server_test.go @@ -143,9 +143,9 @@ func TestServer(t *testing.T) { "hostname": "totoro", "message": "Hello, can you hear me", "service": "callme", - "source": "Adele", + "ddsource": "Adele", "status": "Info", - "tags": []interface{}{"singer:adele"}, + "ddtags": "singer:adele", "timestamp": float64(0)}}, Encoding: "gzip", },