elastic / elastic/ecs-logging-python

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

Offen
#52 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
agent-python
Vorherrschende Sprache
Python
Sterne
74
Forks
33
Ø Merge
9 Std. 3 Min.
Gemergte PRs (30 T.)
1

Beschreibung

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:
```python
req_id = uuid()
...
logger.info("something happend", foo="123", request_id=req_id)

```
should end up being something like this:
```json
{
"http.request.id" : "",
"message": "something happend",
"custom.foo" : 123
...
}
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.