API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

response_body modification in analytics

  • 1.  response_body modification in analytics

    Posted Thu December 05, 2024 09:40 AM

    using this below  code i am able to modify logs.request_body in analytics and able to add logs.custom_data.Response1 in analytics but unable to modify logs.response_body in analytics how to acheive this whether there is any solution

    var apim = require("apim");
    var maskreqdata = apim.getvariable('context.reqmsk');
    var maskrespdata = apim.getvariable('context.ress');
    var logs = context.get('log');
    if(logs){
        logs.custom_data = {};
        logs.request_body =maskreqdata;
        logs.response_body = 'hai';
        logs.custom_data.Response1 =maskrespdata;
        context.set('log',logs);
        console.error("Response: "+maskrespdata)
    }

    Regards,
    Satheesh Jilakoti



    ------------------------------
    satheesh satheeshjilakoti@pronteff.com
    ------------------------------