Is it possible to convert this JSON:
{ "message": "Hello!", "contextMap": { "foo": 1, "bar": 2, ...otherInContextMap }, ...someOther }
(where keys of contextMap
are not known) into the following JSON:
{ "message": "Hello!", "foo": 1, "bar": 2, ...otherInContextMap }
using JMESPath?
(Context: I want to scrape Java logs with contextMap
using Promtail and store message
together with members of contextMap
to Loki.)
EDIT: I need to explicitly pick message
and members of contextMap
. (There are some other unknown/dynamic members ...someOther
in JSON.)