Ad Widget

Collapse

Preprocessing javascript base64 text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • e_merb
    Junior Member
    • Oct 2024
    • 1

    #1

    Preprocessing javascript base64 text

    hi all
    i want to decode base64 encoded text that i sent from zabbix_sender but when in Preprocessing step i return atob(value) i got [object Uint8Array]
    i test with this custom script and just got same result
    Code:
    try {
        b64 = btoa("utf8 string");
        utf8 = atob(b64);
        return utf8;
    }
    catch (error) {
        return {'error.name' : error.name, 'error.message' : error.message}
    }
    how can i decode base64 text in zabbix
  • user_rem
    Junior Member
    • Jan 2025
    • 1

    #2
    hi
    read this: https://www.zabbix.com/documentation...on/whatsnew701

    The JavaScript function atob now returns an array of 8-bit unsigned integers instead of a decoded string.
    and try this code for preprocessing:
    Code:
    var arr = atob(value);
    const decoder = new TextDecoder();
    const str = decoder.decode(arr);
    return str

    Comment

    Working...