How can I put mapping on a remote cluster index

I have connected to a remote cluster. I want to parse a field and extract a value from this field by mapping script. I refer to this article: https://www.elastic.co/guide/en/elasticsearch/reference/7.14/scripting-field-extraction.html
But Elasticsearch seems not to support mapping on a remote cluster. How can I parse a string on a remote cluster?
Thanks