Kibana decode base64 of heberw string into gibberish

Hey all,

I'm using Kibana 5.2.2 and ES 5.2.0
In one of our projects we need to insert XMLs into the Elastic search.
We are using JSON rest requests to insert the XML into the Elastic search.

Since the XML sometime have characters that break the JSON format, we decided to encode the XML with base64 - and then use the Kibana Decode base64 option to decode it for users to see in the discover tab.

The problem is with Hebrew characters, Kibana decoding from base64 converts them into gibberish..
I can only guess it is somehow related to the encoding used by Kibana when decoding the Base64.

When I tried decoding the base64 online (https://www.base64decode.org) everything was decoded correctly and the Hebrew characters were shown.

Could it be that Kibana does not use UTF-8 when decoding ?

Heres an example string containing Heberw chars - encoded with base64:
15DXmdeW16nXlNeVINeY16fXodeYINeR16LXkdeo15nXqg==

Please help :slight_smile:

Unfortunately it looks like you're right - it only supports decoding ascii strings. In 6.0+ this is fixed and will use utf-8.

5.2 won't be getting anymore bug fixes, so in the meantime if you need to get this working. replacing


with return decodeURIComponent(escape(window.atob(str))) should fix things

Hey jbudz,

Thanks for the fast help :slight_smile:

unfortunately , the problem still persists :frowning:

Is there anything else I can try ? (before upgrading to 6.0)

thanks :slight_smile:

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