Create scripted field

Hello, where is the example sourced from and which Kibana version are you using? You may find this thread useful Scripted field in kibana (count)