Layer7 API Management

 View Only
  • 1.  Automate enabling/disabling of Audit Sink Policy

    Posted Nov 23, 2021 12:00 PM

    Can you please guide me , how to schedule enabling/disabling of "Audit Sink policy" using Manage Scheduled Tasks.

    Expectation is to disable the "Audit Sink policy" at specific time during the day (to store the logs in gateway database)  and re-enable back at specific time to (store the logs to external database). This need to happen without manual intervention.  Thanks!



  • 2.  RE: Automate enabling/disabling of Audit Sink Policy

    Posted Nov 24, 2021 03:17 AM
    Edited by Vince Baker Nov 24, 2021 03:29 AM

    Hi,

    I've not looked into other ways, but how about calling Restman to reconfigure your audit config on demand?

    It could be as easy as calling restman to switch the audit config CWPs to only log SEVERE messages during certain times etc.

    Regards

    Vince



    ------------------------------
    Principal Architect
    Apiida AG
    https://www.apiida.com
    ------------------------------



  • 3.  RE: Automate enabling/disabling of Audit Sink Policy

    Posted Dec 07, 2021 11:57 AM

    Hi Vince Baker,

    Thanks for your reply.​

    Audit Sink policy is not a service, Its a policy. Is it possible to call policy with restman?

    Is there any other solution you may please suggest ?




  • 4.  RE: Automate enabling/disabling of Audit Sink Policy

    Posted Dec 09, 2021 01:31 AM

    Hi,

    What I was actually initially suggesting was to set the audit.detailThreshold CWP dynamically using Restman.

    For example:

    curl -k -XPOST -u "admin:7layer -H 'Content-Type: application/xml' -d '<l7:ClusterProperty xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management"> <l7:Name>raudit.detailThreshold</l7:Name> <l7:Value>WARNING</l7:Value> </l7:ClusterProperty>' 'https://localhost:8443/restman/1.0/clusterProperties'



    ------------------------------
    Principal Architect
    Apiida AG
    https://www.apiida.com
    ------------------------------