GET /ops/search
Description
List opevent s matching the specified criteria
Criteria are specified as a set of opevent fields and values, and optional "operation". The returned list includes all opevent s whose fields match the supplied values in the request with the specified "operation".
The response is a JSON array of opevent s, where each opevent object contains all the fields stored in that opevent. The exact fields in a specific event type are available through the showtype method, but the common HTTP event has the following fields:
correlationId Identifies a set of related transactions timestamp The time in milliseconds when this event was generated duration The duration of time the gateway spent processing the > transaction in milliseconds remoteAddr The IP (or other network protocol) address of the remote side of the established communication channel remotePort The port number at the remote system to identify this channel. Where the remote is a server, this will be the well known port number used to contact it. For connections received by the API Server, this will likely be an ephemeral port number allocated by the client's network stack to identify the call. localAddr The IP (or other network protocol) address of the local side of the established connection. This address will be likely assigned to one of the network adapters on the system running the API Server localPort The TCP port number the local system uses to identify the communications channel. For inbound connections, this is the well known port the API Server is listening on where the call arrived. For outbound connections, this will be an ephemeral port allocated by the API Server's operating system. sslsubject For SSL associations, this represents the distinguished name of the peer, as taken from the subject field of their verified certificate. This will be optionally present for inbound associations where the client presented a certificate for mutual authentication. remoteName The name used to contact the remote system, before any DNS lookups are performed (eg, "www.server.com") uri Resource URI status HTTP response status code statustext Data section of the HTTP response status code method HTTP 1.1 method operation WebService operation name service WebService name subject Contains the ID of the authenticated subject (for example, the username supplied by the client). leg Number that identifies a transaction within a correlation bytesent Size of data sent bytesreceived Size of data received
Resource URL
http://localhost:8090/ops/search
Parameters
format | mandatory | The format of the response data. json is currently the only supported format |
protocol | optional | The opevent type to search for, defaulting to http. |
from | optional | Ignore the first from results before returning count opevents |
count | optional | Integer value limiting the number of results. |
ago | optional | Integer value specifying the age of the transactions to list. By default this parameter is specified in milliseconds, but can also be suffixed with h (hours), m (minutes) or s (seconds). Lists transactions that were captured within the specified number of milliseconds, hours, minutes, or seconds. |
field | optional repeatable | Selects a field from which to search. Each field requires a value and an optional op. The search results are limited to those entries where the specified field has a value matching that supplied in the request, where the operation, by default, is equivalence, but can be overriden by op . |
value | conditional repeatable | Selects a value to match for the previous occurrence of field |
op | optional repeatable | The operation to employ for comparison of the database value with that supplied with the previous occurrence of value. op can be one of the following values:
|
Response Codes
Response Code | Description |
---|---|
200 | Success |
Example Transaction
Request
GET /api/router/service/instance-1/ops/search?field=status&value=200&op=ne&format=json HTTP/1.0
Connection: close
Host: localhost
Authorization: Basic YWRtaW46Y2hhbmdlbWU=
Response
HTTP/1.1 200 OK
Server: Gateway
Connection: close
X-CorrelationID: Id-4a5abd53ba000000000000008fe82901 0
Date: Wed, 09 Jul 2014 15:05:47 GMT
Date: Wed, 09 Jul 2014 15:05:47 GMT
Expires: Wed, 09 Jul 2014 15:05:47 GMT
Server: Gateway
Content-Type: application/json
{
"processId": "",
"data": [
{
"uri": "/test",
"status": 403,
"statustext": "Forbidden",
"method": "GET",
"vhost": null,
"bytesSent": 451,
"bytesReceived": 340,
"remoteName": "127.0.0.1",
"remoteAddr": "127.0.0.1",
"localAddr": "127.0.0.1",
"remotePort": "57035",
"localPort": "8080",
"sslsubject": null,
"leg": 0,
"timestamp": 1404918342955,
"duration": 2,
"correlationId": "465abd5313000000000000002cd99d36",
"serviceName": null,
"subject": null,
"operation": null,
"type": "http",
"finalStatus": "Fail"
},
{
"uri": "/hello",
"status": 403,
"statustext": "Forbidden",
"method": "GET",
"vhost": null,
"bytesSent": 451,
"bytesReceived": 341,
"remoteName": "127.0.0.1",
"remoteAddr": "127.0.0.1",
"localAddr": "127.0.0.1",
"remotePort": "56941",
"localPort": "8080",
"sslsubject": null,
"leg": 0,
"timestamp": 1404917585785,
"duration": 30,
"correlationId": "5157bd53050000000000000019a89821",
"serviceName": null,
"subject": null,
"operation": null,
"type": "http",
"finalStatus": "Fail"
}
]
}