Layer7 API Management

  • 1.  Customized Log for Rate Limit

    Posted Sep 26, 2018 07:59 AM

    Hi All,

     

    I am applying rate limit for a service and I want to do "Log Only" if rate limit is exceeded. Howeverit is giving me standard log statement "Rate limit exceeded on rate limiter PRESET(3164e07651ebba0b)*********". I want to customize this log by using the audit statement. Is there any way we can get this statement in a variable so that I can use it in audit statement?

     

    Regards

    Ashutosh



  • 2.  Re: Customized Log for Rate Limit
    Best Answer

    Broadcom Employee
    Posted Sep 26, 2018 06:42 PM

    Hello,

    The variable ${audit.details.last.fullText} can return the audit message of last assertion.

    As it's the message for "last” assertion, you should save it or use it just behind the target assertion, or at the beginning of error handling block.

     

    Regards,

    Mark



  • 3.  Re: Customized Log for Rate Limit

    Posted Sep 27, 2018 03:53 AM

    Hi Mark,

     

    Thanks for your response.

     

    The suggestion you gave is printing the last audit details however I am looking for the rate limit assertion log.

     

    Its printing “20180927 13:19:04.629         INFO                      -4            TRACE:  Assertion Number  - Apply Rate Limit”

     

    I need “20180927 13:19:04.629  INFO                      6950       Rate limit exceeded on rate limiter 10.yyy.abc.zzz”.

     

    Basically above lines are output when rate limit assertions gets triggered.

     

    Best Regards

     

    Ashutosh Singh



  • 4.  Re: Customized Log for Rate Limit

    Broadcom Employee
    Posted Sep 27, 2018 10:06 PM

    From the output you have shown it appears that you have trace debugging on in the policy so it will create a different audit. Try turning off debug tracing and see if the audit appears correct.

     

    Sincerely,

     

    Stephen Hughes



  • 5.  Re: Customized Log for Rate Limit

    Broadcom Employee
    Posted Oct 01, 2018 07:26 AM

    Hi

    Did the answers on this thread  answered your question? If it did please mark it as the right answer.
    When your question is not answered or you still have additional questions please let us know.

    With Kind Regards
    Dirk



  • 6.  Re: Customized Log for Rate Limit

    Posted Oct 01, 2018 08:10 AM

    This answer is actually working in case we have disable the debug log. Is there any way we can get the logs without disabling the debugs ?

     

    Best Regards

     

    Ashutosh Singh



  • 7.  Re: Customized Log for Rate Limit

    Broadcom Employee
    Posted Oct 01, 2018 12:13 PM

    Ashutosh,

     

    There is not a way to accomplish getting that log entry without having the debug tracing disabled. Debug tracing really should only be enabled in rare instances.

     

    Sincerely,

     

    Stephen Hughes