- URL:
- https://<root>/logs/query
- Methods:
GET- Version Introduced:
- 10.9
Access requirements
Required privileges
The Enterprise Administrator API requires privilege-based access. An administrator must be assigned a specific user privilege, or role, to access any given endpoint. Listed below are the user privileges or roles an administrator can be assigned that provides access to this endpoint. If multiple privileges are listed, only one needs to be assigned to gain access.
Tokens
This API requires token-based authentication. A token is automatically generated for administrators who sign in to the Enterprise Administrator API directory's HTML interface. Tokens generated in this way are stored for the entirety of the session.
Those accessing the API directory outside of the HTML interface will need to acquire a session token from the generate operation in the Enterprise Directory API. For security reasons, all POST requests made to the Enterprise Administrator API must include a token in the request body.
Description
The query operation allows users to aggregate, filter, and page through logs for an ArcGIS Enterprise on Kubernetes deployment.
Request parameters
| Parameter | Details |
|---|---|
(Required) | The base log level for the logs being queried. Only logs at that same log level, or at a log level with higher severity, will be returned. The default level is the log level currently set for the organization. Values: |
(Optional) | The most recent time used to query logs, formatted as either a time stamp ( Example |
(Optional) | The oldest time used to query logs, formatted as either a time stamp ( Example |
(Optional) | Specifies the log codes assigned to the logs. When specified, query will return logs associated with those codes. Example |
(Optional) | The user name of a user within the organization to further filter log results. Example |
(Optional) | An ID assigned to a specific server event. Example |
(Optional) | The service type of a service within the organization to further filter query results. Example |
(Optional) | The source of logged events. Examples |
(Required) | The maximum number of log records to be returned by this query. The default messages per page is 1000. The limit for this parameter is 10000 records. Example |
(Optional) | The index of the first log to be returned by this query. The response will exclude every log with a smaller index. The default index is 1. Example |
(Required) | A binary that specifies whether stack traces of exceptions will be included with the returned logs. The default is Values: |
| The response format. The default response format is Values: |
Example usage
The following is a sample request for the query operation:
https://organization.example.com/<context>/admin/logs/query?logLevel=INFO&startTime=2020-08-09T22:45:06&endTime=2020-08-09T22:45:00&users=user1&requestIDs=&num=1000&start=10&showStackTraces=false&f=pjsonJSON Response example
The following is a collection of logs from a query of INFO logs associated with the user user1 and created between 2020-08-09 and 2020-08-09:
{
"messages": [
{
"msgTimestamp": "2020-08-09T22:45:06,852",
"logLevel": "INFO",
"requestId": "",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Item '348254a44fe34c26af8be121ff071134' (id:348254a44fe34c26af8be121ff071134) updated.",
"source": "Sharing",
"pod": "gis-portal-sharing-7cf9668cc9-mdsbh",
"logCode": "202010",
"processID": "65",
"threadID": "63",
"serverID": "",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:06,731",
"logLevel": "INFO",
"requestId": "",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Item 'e1d3f7a0cd784f61b79ed66d317ee485' updated.",
"source": "Sharing",
"pod": "gis-portal-sharing-7cf9668cc9-mdsbh",
"logCode": "202010",
"processID": "65",
"threadID": "66",
"serverID": "",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:05,728",
"logLevel": "INFO",
"requestId": "f8372b7e-23b7-4aff-8974-d59ac5f7b0e3",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Service 'SampleService.MapServer' was started successfully.",
"source": "Enterprise Admin",
"pod": "gis-enterpriseadmin-7b988bddd7-ds67d",
"logCode": "1251",
"processID": "1",
"threadID": "66",
"serverID": "",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:05,728",
"logLevel": "INFO",
"requestId": "f8372b7e-23b7-4aff-8974-d59ac5f7b0e3",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Service 'SampleService.MapServer' was created successfully.",
"source": "Enterprise Admin",
"pod": "gis-enterpriseadmin-7b988bddd7-ds67d",
"logCode": "1249",
"processID": "1",
"threadID": "66",
"serverID": "",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:05,432",
"logLevel": "INFO",
"requestId": "",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Service 'SampleService.MapServer' started successfully.",
"source": "",
"pod": "gis-v8fe9d235-ee20-4779-8770-ff9c493c2f66-mapserver-6d7cd5zrgdh",
"logCode": "10021",
"processID": "1",
"threadID": "1",
"serverID": "v8fe9d235-ee20-4779-8770-ff9c493c2f66",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:05,323",
"logLevel": "INFO",
"requestId": "",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Server object instance created successfully - SampleService.",
"source": "",
"pod": "gis-v8fe9d235-ee20-4779-8770-ff9c493c2f66-mapserver-6d7cd5zrgdh",
"logCode": "8000",
"processID": "171",
"threadID": "23",
"serverID": "v8fe9d235-ee20-4779-8770-ff9c493c2f66",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:05,314",
"logLevel": "INFO",
"requestId": "",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Construct ended.",
"source": "SampleService.MapServer",
"pod": "gis-v8fe9d235-ee20-4779-8770-ff9c493c2f66-mapserver-6d7cd5zrgdh",
"logCode": "12003",
"processID": "38",
"threadID": "41",
"serverID": "",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:05,299",
"logLevel": "INFO",
"requestId": "",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Construct started.",
"source": "SampleService.MapServer",
"pod": "gis-v8fe9d235-ee20-4779-8770-ff9c493c2f66-mapserver-6d7cd5zrgdh",
"logCode": "12002",
"processID": "38",
"threadID": "41",
"serverID": "",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:05,283",
"logLevel": "INFO",
"requestId": "",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Construct ended.",
"source": "SampleService.MapServer",
"pod": "gis-v8fe9d235-ee20-4779-8770-ff9c493c2f66-mapserver-6d7cd5zrgdh",
"logCode": "16003",
"processID": "38",
"threadID": "41",
"serverID": "",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:05,271",
"logLevel": "INFO",
"requestId": "",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Construct started.",
"source": "SampleService.MapServer",
"pod": "gis-v8fe9d235-ee20-4779-8770-ff9c493c2f66-mapserver-6d7cd5zrgdh",
"logCode": "16002",
"processID": "38",
"threadID": "41",
"serverID": "",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:03,147",
"logLevel": "INFO",
"requestId": "",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Item 'e09d419948194eefb833c88e0dc6ffce' updated.",
"source": "Sharing",
"pod": "gis-portal-sharing-7cf9668cc9-mdsbh",
"logCode": "202010",
"processID": "65",
"threadID": "65",
"serverID": "",
"serviceTypes": "",
"exceptionDetail": ""
},
{
"msgTimestamp": "2020-08-09T22:45:01,122",
"logLevel": "INFO",
"requestId": "",
"node": "reverseproxy.example.com",
"username": "user1",
"msg": "Item '55a29baae49b4962aea6e663e41abc4b' updated.",
"source": "Sharing",
"pod": "gis-portal-sharing-7cf9668cc9-mdsbh",
"logCode": "202010",
"processID": "65",
"threadID": "61",
"serverID": "",
"serviceTypes": "",
"exceptionDetail": ""
}
],
"total": 21,
"start": 10,
"num": 1000,
"nextStart": -1,
"query": "{\"logLevel\":\"INFO\",\"logCode\":[],\"username\":[],\"requestId\":[],\"serviceTypes\":[],\"exceptionDetail\":false}"
}