Have Kibana display a numeric field value in hexadecimal is locked, and the example is an image (and broken) which is not useful for cut-and-paste. If it wasn't locked I'd just reply there.
I needed to change the dns.id of packetbeats to hex so that I could easily visualize my wireshark pcap files.
Here is the painless script I used for that.
if (doc['dns.id'].size()==0) {
return "";
}
long dnsId = doc['dns.id'].value;
String asHex = Long.toHexString(dnsId);
return "0x" + asHex