API Connect

 View Only
  • 1.  usage of log policy in IBM APIC v 10.0.5.3-4934

    Posted Fri September 15, 2023 04:06 AM

    I am trying to log policy to log a custom variable which I had set use set variable policy. The log policy is preceded by the set variable policy where I have added a variable by name Code which would take value from message.body.Details.Status_Code. Post which I am suing the log policy to log that value. But the value doesn't get logged. below screen shot of the polcy settings of set variable and log:

    Set-variable:

    log policy:

    Why is the code value not populating in the analytics logs. Please help.



    ------------------------------
    Radhika Tharayil
    ------------------------------


  • 2.  RE: usage of log policy in IBM APIC v 10.0.5.3-4934

    Posted Mon September 18, 2023 03:25 AM

    Hiya

    Try following the steps here: https://www.ibm.com/docs/en/api-connect/10.0.5.x_lts?topic=analytics-modifying-api-event-data

    Basically you need a log policy up front that sets up the log context variable (in gather-only mode), then you can add any data you want to the log.custom_data array, and it will be automatically sent to analytics at the end of the flow, no additional log policy is needed for that.

    Please make sure you only add custom data to the custom_data array as that will mean it will be indexed in analytics and can be queried by the API etc.



    ------------------------------
    Chris Dudley
    ------------------------------



  • 3.  RE: usage of log policy in IBM APIC v 10.0.5.3-4934

    Posted Mon September 18, 2023 06:42 AM

    Thank you Chris! it works.



    ------------------------------
    Radhika Tharayil
    ------------------------------