It sounds like what you want is to use a Scripted Field in Kibana. Note that you cannot do aggregations on scripted fields, but you can use them to filter on.
If you do need to do aggregations, I recommend using a Ingest Pipeline in Elasticsearch which allows you to modify data before it is ingested. Once you have this working, you can reindex all of the documents to re-process the existing docs that were created before you configured the pipeline.
Due to our current project permissions, I won't be able to add scripted fields under Kibana. Just wanted to know if Json Input can be similar to scripted fields so that the fields are only created/generated at visualization time.