Skip to content

how to prefix structlog log value with "custom." or route them to a certain ecs field #52

Open
@mxab

Description

@mxab

Hi,
according to the ecs documentation non ecs standard fields should go under "custom."
Also I might log data that should go to a certain ecs field

but i'm not sure how to configure something like this in structlog/ecs-logging.

for example this:

req_id = uuid()
...
logger.info("something happend", foo="123", request_id=req_id)

should end up being something like this:

{
 "http.request.id" : "<generated_req_uuid>",
 "message": "something happend",
 "custom.foo" : 123
...
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions