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

Expected JSON format - timestamp #34

@kklopfenstein

Description

@kklopfenstein

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions