Skip to content
This repository has been archived by the owner on Feb 22, 2021. It is now read-only.

Expected JSON format - timestamp #34

Open
kklopfenstein opened this issue Sep 30, 2018 · 0 comments
Open

Expected JSON format - timestamp #34

kklopfenstein opened this issue Sep 30, 2018 · 0 comments

Comments

@kklopfenstein
Copy link
Contributor

kklopfenstein commented Sep 30, 2018

It looks like if log events are in JSON format, cwlogs expects the JSON to be structured in this format:

type Event struct {
	Level   Level     `json:"level"`
	Time    time.Time `json:"time"`
	Info    EventInfo `json:"info"`
	Data    EventData `json:"data"`
	Message string    `json:"message"`
}

https://github.com/segmentio/ecs-logs-go/blob/46096d8f38d354840bbc51bf2d425416a907dd6b/event.go#L63

Our project outputs logs with a timeMillis epoch value and it took a while to get to the bottom of why the time was displaying incorrectly.

Does documentation exist somewhere on this event format? Also, I think that the timestamp should be populated for the event based on the AWS event timestamp if the json timestamp isn't found.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant