How to use array variable in regex. Painless scripted field

Yes, this is how to add one to Kibana.

saving one is just doing the same and looking for the field name inside the JSON you get from cURL.