Painless, if two field exists then calculate

Hi,
I open the same event on two different ELK (5.5.1 and 6.1.1) on kibana and switch to "json" view:

all timestamp fields for version 6.1.1 have a format "text" for version 5.1.1 have format "Unix time". Fields have the same look and same type = date, difference only in "json" view.
for my script, I chose type =number, Format = Number.
this works on es 5.5.1