If the context is sent as an alarm from opendistro, it looks like the following when received from a custom webhook (flask python). (when sent like {{ctx}})
b’{monitor={_id=, _version=1}, periodStart=2021-03-30T02:02:37.300Z}’
Is there a good way to get a json type or convert the received text into a python dictionary?
When I tried using python’s ‘json’ library, I had the following problem.
- The key is not enclosed in double quotation marks.
- Value is not enclosed in double quotation marks.
- There is an empty value.
- It is not in the form of ‘key:value’, but in the form of ‘key=value’.
- Value contains ‘:’.