Get specific logs
GET https://{{host}}/edge-diagnostics/v1/grep?edgeIp={{edgeIp}}&cpCode={{cpCode}}
Using the grep
command, returns logs that match the query parameters. This operation gets the data directly. If you don't have detailed information about the logs or you want to avoid latency, run the Launch a GREP request operation. If you provide request parameters for which Edge Diagnostics doesn't find logs, you get the validation error.
Body
PARAM
Key | Datatype | Required | Description |
edgeIp
|
string | (Required) IP address that belongs to edge server and you want to get the logs for. To verify if an IP address belongs to an edge server, run the [Verify an IP](https://techdocs.akamai.com/edge-diagnostics/reference/post-verify-edge-ip) operation. To get the IP, you may need to run the [Get domain details with dig](https://techdocs.akamai.com/edge-diagnostics/reference/post-dig) or [Get diagnostic data of a group](https://techdocs.akamai.com/edge-diagnostics/reference/get-user-diagnostic-data-group-records) operation first. This is the IP value from the `answerSection` array in the [Get domain details with dig](https://techdocs.akamai.com/edge-diagnostics/reference/post-dig) operation response or the `ip` value from the `edgeIps` array in the [collected diagnostic data](https://techdocs.akamai.com/edge-diagnostics/reference/get-user-diagnostic-data-group-records). | |
cpCode
|
string | (Required) CP code you want to get the logs for. | |
clientIp
|
string | (Optional) Client IP to filter the logs by. | |
objectStatus
|
string | (Optional) Object status codes you want to get the logs for. To see available values, check [Object status codes](https://techdocs.akamai.com/edge-diagnostics/docs/object-status). | |
httpStatusCode
|
string | (Optional) HTTP status code to filter the logs by. | |
userAgent
|
string | (Optional) User agent to filter the logs by. | |
arl
|
string | (Optional) [ARL](https://techdocs.akamai.com/edge-diagnostics/docs/arl-syntax) to filter the logs by. | |
start
|
string | (Optional) ISO 8601 timestamp for a point of time in the past when the log search window starts. You can get the logs from either the last 6 or 24 hours depending on the server and traffic conditions. The recommended 10-minute periods ensure that data fetches quickly and you get the most relevant logs. | |
end
|
string | (Optional) ISO 8601 timestamp for a point of time in the past when the log search window ends. | |
logType
|
string | (Optional) __Enum__ Record type of the logs. Possible values are either `R` for client requests to an edge server or `F` for forward requests from an edge server to the origin. | |
accountSwitchKey
|
string | (Optional) For customers who manage more than one account, this [runs the operation from another account](https://techdocs.akamai.com/developer/docs/manage-many-accounts-with-one-api-client). The Identity and Access Management API provides a [list of available account switch keys](https://techdocs.akamai.com/iam-api/reference/get-client-account-switch-keys). |
HEADERS
Key | Datatype | Required | Description |
Accept
|
string |
RESPONSES
status OK
{
"createdBy": "hgildong",
"createdTime": "2021-04-15T07:48:30Z",
"executionStatus": "SUCCESS",
"logLinesCount": 2,
"request": {
"cpCodes": [
1234567
],
"edgeIp": "192.0.2.0",
"end": "2022-03-15T06:08:43.000Z",
"httpStatusCodes": {
"comparison": "EQUALS",
"value": [
"400"
]
},
"logType": "R",
"objectStatus": "pxR",
"start": "2022-03-15T06:08:40.000Z"
},
"result": {
"legend": {
"fObjectStatus": {
"W": "The object TTL was set in response headers."
},
"fObjectStatus2": {},
"fObjectStatus3": {},
"logType": {
"f": "(f) going forward to forward hostname",
"r": "(r) response to client"
},
"rObjectStatus": {
"W": "The object TTL was set in response headers."
},
"rObjectStatus2": {
"N": "The request was processed over an anycast VIP and is marked as zero rated billing request.",
"o": "The origin server was contacted for the request.",
"x": "Either 'no-store' is turned on by metadata and not disabled by \"!no-store\" in the response or the downstream TTL was set by metadata and not by the response header."
},
"rObjectStatus3": {}
},
"logs": [
{
"arl": "/D/1682/1234567/000/example.com./ERR_READ_TIMEOUT",
"bytesReceived": "-",
"bytesServed": "568",
"clientIp": "192.0.2.6",
"contentBytesServed": "250",
"contentType": "text/html",
"cookie": "-",
"cpCode": "1234567",
"dateTime": "2021-08-24T10:14:09.306Z",
"edgeIp": "192.0.2.10",
"error": "ERR_READ_TIMEOUT|before_resp_hdrs",
"forwardIp": "-",
"hostHeader": "etranslator.edgesuite.net",
"httpMethod": "GET",
"httpStatus": "504",
"logType": "r",
"objectSize": "250",
"objectStatus": "W",
"objectStatus2": "xNo",
"objectStatus3": "-",
"referer": "-",
"sslVersion": "TLSv1.2",
"timeTaken": "0",
"turnaroundTime": "598",
"userAgent": "Mozilla/5.0%20(Macintosh;%20Intel%20Mac%20OS%20X%2010_15_7)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/92.0.4515.159%20Safari/537.36"
},
{
"arl": "/D/1682/1234567/000/example.com./ERR_READ_TIMEOUT",
"bytesReceived": "0",
"bytesServed": "-",
"clientIp": "192.0.2.6",
"contentBytesServed": "-",
"contentType": "-",
"cookie": "-",
"cpCode": "1234567",
"dateTime": "2021-08-24T10:14:09.356Z",
"edgeIp": "192.0.2.10",
"error": "-",
"forwardIp": "192.0.2.11",
"hostHeader": "-",
"httpMethod": "GET",
"httpStatus": "0",
"logType": "f",
"objectSize": "-",
"objectStatus": "W",
"objectStatus2": "-",
"objectStatus3": "-",
"referer": "-",
"sslVersion": "TLSv1.2",
"timeTaken": "0",
"turnaroundTime": "0",
"userAgent": "-"
}
]
},
"suggestedActions": [
"Check for long times.",
"Check content length/bytes served."
]
} |
ENDPOINTS