在一些流利的解析器和过滤器之后,我得到了以下 json:
{
"date":1628534756.632903,
"text":"2021-08-09 18:45:56.632 | INFO | asgi:main:30 - {'version': '1', 'deploymentid': '73d37bf2-2af9-4f78-b7d5-92ccc0a41652', 'time': '2021-08-09T18:45:59.510822907Z'}\n",
"record":{
"elapsed":{
"repr":"3 days, 0:53:36.716614",
"seconds":262416.716614
},
"exception":null,
"extra":{
},
"file":{
"name":"asgi.py",
"path":"/app/asgi.py"
},
"function":"main",
"level":{
"icon":"ℹ️",
"name":"INFO",
"no":20
},
"line":30,
"message":"{'version': '1', 'deploymentid': '73d37bf2-2af9-4f78-b7d5-92ccc0a41652', 'time': '2021-08-09T18:45:59.510822907Z'}",
"module":"asgi",
"name":"asgi",
"process":{
"id":15,
"name":"MainProcess"
},
"thread":{
"id":140294663935808,
"name":"MainThread"
},
"time":{
"repr":"2021-08-09 18:45:56.632046+00:00",
"timestamp":1628534756.632046
}
}
}
我想应用另一组解析器和/或过滤器以得到以下 json:
{
"date":1628534756.632903,
"message":"{'version': '1', 'deploymentid': '73d37bf2-2af9-4f78-b7d5-92ccc0a41652', 'time': '2021-08-09T18:45:59.510822907Z'}"
}
我的意思是,提升message
一个级别并删除所有其他键,除了date
.
我尝试使用一些过滤器grep
,nest/lift
但没有成功。
怎么可能做到?