Layer 7 API Management

Expand all | Collapse all

Find the requests for a specific policy in Gateway

  • 1.  Find the requests for a specific policy in Gateway

    Posted 11-07-2017 04:41 PM

    Hi Friends, 

     

    How can i find the number of requests  came for a specific gateway policy ?  which table  in mysql has the info ?

     how to see the response that being sent ? 



  • 2.  Re: Find the requests for a specific policy in Gateway

    Posted 11-07-2017 05:25 PM

    Hello, 

     

    For the first 2 questions; there is not just one table that can give you the answer. the metrics themselves are stored in the service_usage table. but the service id is goid of the policy. The service goid is stored in the published_service table. running the following command will join the table and give you the information that I believe you are looking for: 

    select a.requestnr, a.completedreqnr,b.name from service_usage a, published_service b where a.serviceid=b.goid;

     

    the screenshot shows the output:

     

    Note: Use caution searching the DB directly as this is where all important Gateway information is stored. 

     

    For your question about viewing the response, you can drag an "Audit Messages in Policy" to  the top of the service and click the always radio button for the response. 

     

    This will allow the response to be viewed from the audit viewer next to the associated logs tab. 

     

     

    Hope this helps!



  • 3.  Re: Find the requests for a specific policy in Gateway

    Posted 11-08-2017 05:42 AM

    Hi,

     

    Thanks for the quick response.  Out of all the requests that come thru the policy.

     

    In this case Cert based authentication.  How can find requests that came with specific Cert  in the Input Json  ?

     

    Thanks

    Naveen



  • 4.  Re: Find the requests for a specific policy in Gateway

    Posted 11-08-2017 12:06 PM

    Unfortunately, the database encrypts the request and the response so seeing the JSON payload will not be possible without using the policy manage view audit events window. The table is audit_message but will have to be joined to another to look for a specific service. you can use the following mysql call to get the data: 

    select b.name, b.user_name, b.user_id, b.provider_goid, b.signature, a.* from audit_message a, audit_main b where a.goid = b.goid\G;  

     

    The data might populate in the b.signature row. Hope this can help. 



  • 5.  Re: Find the requests for a specific policy in Gateway

     
    Posted 11-08-2017 04:49 PM

    Also want to add that you can use the Dashboard to simply check the number of requests for any service or policy. You can also reset this count to get a new baseline. View -> View Dashboard from the top of Policy Manager.

     

    You could also look into using the "traffic log" log type as this may help you ascertain more metrics types of information that could be sent to syslog and/or a log analysis tool to monitor and track service metrics. This log has two major parts, the actual "traffic log" created from Manage Log/Audit Sinks and a cluster-wide property called "trafficlogger.detail" that is used to configure what data you wish to log. This trafficlogger.detail Cluster-Wide Property contains many key-value pairs and controls what items are logged for every request. These key-value pairs reference pre-defined context variables (things such as http method, service name, service uri, response code, raw response, elaposed time, etc) and can be changed in an ad-hoc manner. Please note the physical logs will exist on each node in a cluster and it's highly recommended to implement syslog along with this traffic log to have a more central destination to view and analyze logs/data.

     

    To create the initial traffic log, go to Tasks -> Manage Log/Audit Sinks, then Create. For the filter add the Category=Traffic Logger and make sure to check "enabled" and you can click "OK" to close. The log will now be created.

     

    You will likely want to add/replace the OOTB values in trafficlogger.detail as it is lacking information by default. To do this, go to Tasks -> Global Settings -> Manage Cluster-wide Properties. Then open the dropdown and find "trafficlogger.detail", and you will see key-value pairs associated with this property. Click OK to add the property. At any time, you may add and/or remove these key-value pairs as you see fit for the trafficlogger.detail Cluster-Wide Property. These changes will take effect immediately.

     

    Below are examples of variables that can be used inside trafficlogger.detail Cluster-Wide Property:

    Transport Layer Context Variables - CA API Gateway - 9.2 - CA Technologies Documentation 

    System Variables - CA API Gateway - 9.2 - CA Technologies Documentation 

    Service/Policy Context Variables - CA API Gateway - 9.2 - CA Technologies Documentation 

    Message Routing Context Variables - CA API Gateway - 9.2 - CA Technologies Documentation 

    Message Layer Context Variables - CA API Gateway - 9.2 - CA Technologies Documentation