elastic / elastic/ecs-logging-python

ECS schema validation in logger

オープン
#58 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る
agent-python
主要言語
Python
スター
74
フォーク
33
平均マージ
9時間 3分
マージ済み PR(30日)
1

説明

Hi,

This is more of a question than an issue. Is there a validation feature in `ecs-logging-python` library? I wish to avoid mapping conflict later on during the application on-boarding process, and I wish to make the app ECS compatible from it's very inception.

Currently adding extra fields is simple:
```python
logger.debug(f"Creating directory. {x}", extra={"not_an_ecs_field.method": "get", "source.ip": 22})
```

I have added two fields, one of which is not really an ECS schema field while the other has an invalid data type. I was wondering if I could pass in the ECS schema as a JSON and have the logger do the validation. I read an option to pass in a validator [here](https://github.com/elastic/ecs-logging-python/blob/master/ecs_logging/_stdlib.py#L112), but not sure what it expects.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。