query_api_requests
Query Kong API Gateway request logs with filters on time, status codes, HTTP methods, services, routes, and consumers. Analyze traffic patterns and performance metrics.
Instructions
Query and analyze Kong API Gateway requests with customizable filters. Before calling this it's necessary to have a controlPlaneID and a serviceID or routeID. These can be obtained using the list-control-planes, list-services, and list-routes tools.
INPUT:
timeRange: String - Time range for data retrieval (15M, 1H, 6H, 12H, 24H, 7D)
statusCodes: Number[] (optional) - Filter by specific HTTP status codes
excludeStatusCodes: Number[] (optional) - Exclude specific HTTP status codes
httpMethods: String[] (optional) - Filter by HTTP methods (e.g., GET, POST)
consumerIds: String[] (optional) - Filter by consumer IDs
serviceIds: String[] (optional) - Filter by service IDs. The format of this field must be ":".
routeIds: String[] (optional) - Filter by route IDs. The format of this field must be "controlPlaneID:routeID"
maxResults: Number - Maximum number of results to return (1-1000)
OUTPUT:
metadata: Object - Contains totalRequests, timeRange, and applied filters
requests: Array - List of request objects with details including:
requestId: String - Unique request identifier
timestamp: String - When the request occurred
httpMethod: String - HTTP method used (GET, POST, etc.)
uri: String - Request URI path
statusCode: Number - HTTP status code of the response
consumerId: String - ID of the consumer making the request
serviceId: String - ID of the service handling the request
routeId: String - ID of the matched route
latency: Object - Response time metrics
clientIp: String - IP address of the client
and many more detailed fields...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| routeIds | No | Filter by route IDs (from list-routes tool) | |
| timeRange | No | Time range for data retrieval (15M = 15 minutes, 1H = 1 hour, etc.) | 1H |
| maxResults | No | Number of items to return per page | |
| serviceIds | No | Filter by service IDs | |
| consumerIds | No | Filter by consumer IDs | |
| httpMethods | No | Filter by HTTP methods (e.g. ['GET', 'POST', 'DELETE']) | |
| statusCodes | No | Filter by specific HTTP status codes (e.g. [200, 201, 404]) | |
| excludeStatusCodes | No | Exclude specific HTTP status codes (e.g. [400, 401, 500]) |