*Query log
Requests
HTTP request
GET /v5/logs/search
Get logs
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| start_time | number | True | timestamp of start time range |
| end_time | number | True | timestamp of end time range |
| pageno | number | True | request page number |
| size | number | False | page size |
| region_name | string | True | name of cluster |
| kubernetes_namespace | string | False | comma seperated names of k8s namespace |
| project_name | string | False | comma seperated names of projects |
| application_name | string | False | comma seperated names of application |
| node | string | False | comma seperated names of node |
| pod_name | string | False | comma seperated names of pod |
| container_id8 | string | False | comma seperated first 8 chars of docker container id |
| file_name | string | False | comma seperated names of path |
| component | string | False | comma seperated names of component |
| fields | string | False | field names seperated with comma |
| type | string | False | type of logs, choices: system, platform, kubernetes, workload, default to workload |
| query_string | string | False | full text search query |
| ascending | boolean | False | in ascending order, default to false |
| workload | string | False | workload type and workload name pairs, such as: Deployment:lanaya,StatefulSet:apollo |
Responses
Content-Type
application/json
Status code: 200
OK
Sample response
log search result
{
"items": [
{
"spec": {
"data": {
"@timestamp": "2021-06-24T06:52:26+000000",
"application_name": "",
"component": "",
"container_id": "207a2bbb480fd4f6e90448140f764d2f094e2d8857ba2598e71f99dad9fd84da",
"container_id8": "207a2bbb",
"docker_container_name": "service-b",
"file_name": "stdout",
"kubernetes_container_name": "service-b",
"kubernetes_labels": {
"app": "service-b",
"asm.cpaas.io/msname": "service-b",
"asm.cpaas.io/msselector": "service-b",
"istio.io/rev": "default",
"msname": "service-b",
"pod-template-hash": "8f79c848b",
"project.cpaas.io/name": "asm",
"security.istio.io/tlsMode": "istio",
"service.cpaas.io/name": "deployment-service-b",
"service.istio.io/canonical-name": "service-b",
"service.istio.io/canonical-revision": "v1",
"topology.istio.io/network": "asm-ovn",
"version": "v1"
},
"kubernetes_namespace": "asm-e2e-demo-ns",
"log_data": "envs:\n",
"log_id": "1624517544702340-1624517546346915623",
"log_index": "log-workload-20210624",
"log_level": "0",
"log_type": "log",
"node": "192.168.17.21",
"nodes": "",
"paths": "stdout",
"pod_id": "1674637a-ca7e-4394-93c9-01a1bde2c699",
"pod_name": "deploy-b-8f79c848b-9gs4m",
"product": "",
"project_name": "asm",
"provider": "",
"region_id": "donotcare",
"region_name": "ovn",
"root_account": "alauda",
"source": "container",
"time": 1624517544.70234
}
}
}
],
"total_items": 1,
"total_page": 1
}Parameters
| Name | Type | Description |
|---|---|---|
| items | array |
items
Path: items |
| items[] | object |
object holding the log data
Path: items[] |
| total_items | integer |
Total count of all logs satisfies the specified conditions
Path: total_items |
| total_page | integer |
Total page number of all logs satisfies the specified conditions
Path: total_page |