Kibana scripted fields

i tried this method @nishant.saini but it is throwing an error saying "Script is invalid".