Try to define the runtime field without a script.
You can use just:
PUT your-index/_mapping
{
"runtime": {
"s3_filename": {
"type": "keyword"
}
}
}
This will change the mapping of the field s3_filename to keyword on runtime (this can have some impact in the performance).
If for some reason you need to remove this runtime mapping, just use:
PUT your-index/_mapping
{
"runtime": {
"s3_filename": null
}
}