elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.77k stars 8.17k forks source link

[ResponseOps][discuss] convert "JSON bags" in alerting Saved Objects to plain objects #155169

Open pmuellr opened 1 year ago

pmuellr commented 1 year ago

In PR [RAM] ResponseOps saved object updates #152857, we've stopped indexing our "JSON bag" fields:

What's a "JSON bag"? The fields above are currently indexed as text fields, in which we store JSON objects, serialized as a string. So when we "read" these fields, we need to JSON.parse() them, and when we "write" these fields, we need to JSON.stringify() them. Which is clumsy, and the resulting source documents are hard to read.

In theory, we could change to store these as plain old object instead:

The one downside I know if is dealing with partial updates. Currently our JSON bag approach means we never do partial updates of these JSON bags - the entire object is replaced. With the new approach, partial updates are possible, and will be problematic - we'd really need to convert any fields not set (or set to undefined) to null. Or ensure our ES updates are not doing partial updates.

elasticmachine commented 1 year ago

Pinging @elastic/response-ops (Team:ResponseOps)