Get log
- Print
- PDF
Get log
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Available in Classic and VPC
Get logs collected from the Cloud Log Analytics service.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
POST | /api/{regionCode}-v1/logs/search |
Request headers
For information about the headers common to all Cloud Log Analytics APIs, see Cloud Log Analytics request headers.
Request path parameters
You can use the following path parameters with your request:
Field | Type | Required | Description |
---|---|---|---|
regionCode | String | Required | Region code
|
Request body
You can include the following data in the body of your request:
Field | Type | Required | Description |
---|---|---|---|
interval | String | Optional | Query interval
|
keyword | String | Optional | Query keyword
|
logTypes | String | Optional | Log type
|
timestampFrom | String | Optional | Query start date and time
|
timestampTo | String | Optional | Query end date and time
|
pageNo | Integer | Optional | Page number
|
pageSize | Integer | Optional | Number of items per page
|
Request example
The request example is as follows:
curl --location --request POST 'https://cloudloganalytics.apigw.ntruss.com/api/{regionCode}-v1/logs/search' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'Content-Type: application/json' \
-date '{
"interval": "30m",
"pageNo": 1,
"pageSize": 3
}'
Response
This section describes the response format.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
code | Integer | - | Response status codes |
message | String | - | Response status message |
result | Object | - | Response result |
result.pageSize | Integer | - | Number of items per page |
result.currentPage | Integer | - | Current page number |
result.totalPage | Integer | - | Total page number |
result.totalCount | Integer | - | Total number of logs |
result.isPaged | Boolean | - | Whether additional pages exist
|
result.chartData | Array | - | Number of logs
|
result.searchResult | Array | - | Query result |
searchResult
The following describes searchResult
.
Field | Type | Required | Description |
---|---|---|---|
logTime | Integer | - | Log occurrence time
|
logType | String | - | Log type |
servername | String | - | Name of server to collect logs from |
logDetail | String | - | Log content |
Response status codes
For response status codes common to all Cloud Log Analytics APIs, see Cloud Log Analytics response status codes.
Response example
The response example is as follows:
{
"code": 0,
"message": "The request has been successfully processed.",
"result": {
"pageSize": 3,
"currentPage": 1,
"totalPage": 1695,
"totalCount": 5083,
"isPaged": true,
"chartData": [
[
1731987000000,
2111
],
[
1731988800000,
2620
],
[
1731990600000,
352
]
],
"searchResult": [
{
"logTime": "1731990853000",
"logType": "CDB_MSSQL",
"servername": "m-100514954-002",
"logDetail": "select \r\n\tcase \r\n\t\twhen count(a.name) + count(b.name) = 0 then 'not exists'\r\n\t\twhen count(a.name) + count(b.name) = 1 then 'stop'\r\n\t\twhen count(a.name) + count(b.name) = 2 then 'start'\r\n\tend xe_status\r\nfrom sys.server_event_sessions a\r\n\tleft join sys.dm_xe_sessions b\r\n\ton a.name = b.name \r\nwhere a.name = 'AuditLog'"
},
{
"logTime": "1731990847925",
"logType": "ses_log",
"servername": "{name=ses-test-m-62vl}",
"logDetail": "[2024-11-19T13:34:07,621][WARN ][o.o.p.c.u.JsonConverter ] [ses-test-m-62vl] Json Mapping Error: Cannot invoke \"java.lang.Long.longValue()\" because \"this.cacheMaxSize\" is null (through reference chain: org.opensearch.performanceanalyzer.collectors.CacheConfigMetricsCollector$CacheMaxSizeStatus[\"Cache_MaxSize\"])"
},
{
"logTime": "1731990847000",
"logType": "CDB_MSSQL",
"servername": "m-100514954-001",
"logDetail": "select \r\n\tcase \r\n\t\twhen count(a.name) + count(b.name) = 0 then 'not exists'\r\n\t\twhen count(a.name) + count(b.name) = 1 then 'stop'\r\n\t\twhen count(a.name) + count(b.name) = 2 then 'start'\r\n\tend xe_status\r\nfrom sys.server_event_sessions a\r\n\tleft join sys.dm_xe_sessions b\r\n\ton a.name = b.name \r\nwhere a.name = 'AuditLog'"
}
]
}
}
Was this article helpful?