Have Kibana display a numeric field value in hexadecimal

Hello,

How can I tell Kibana to display a numeric field in hexadecimal or octal?

I have looked into the formatting options and numeral.js, but nothing concerning which base to use for displaying numeric values...

I'd like to avoid adding multi-fields to my indices for data numeric to cope with that.

Thanks for the help !

Olivier

hi @makibroshett,

You can use scripted fields to do that. Use the conversion methods exposed by the Painless scripting language.

E.g., for a double to HEX conversion, it'd look something like:

image

More info about the Painless API you can find here: https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-api-reference.html

thx,

Hi Thomas

Ah! Another aspect of E(L)K I had never scratched. It worked great, thank you for pointing me to that.

Best regards

Olivier

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

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