Ways To Extract The Robot Logs

How to pull / extract the Robot Logs data in CSV format?

Robot logs are time-stamped files which contain informational events, errors and warning messages relevant to the application.

If Orchestrator is unavailable, logs are stored in a local database (C:\Windows\SysWOW64\config\systemprofile\AppData\Local\UiPath\Logs\execution_log_data), within the available disk space, until the connection is restored. When the connection is restored, the logs are sent in batches in the order they had been generated.


In order to extract the same, follow the below based on the type of deployment:



For On - Premises Deployment:

  • Extracting logs using API calls(one may use Swagger/Postman):
- Using Swagger:
  1. Log in to Orchestrator.
  2. Open a new tab to open the Swagger: Go to <Orchestrator URL>\Swagger
  3. Refer to Retrieving Robot Logs According to the Robot Name documentation to start calling Robot logs API(s).

Pre-requisite:
X-UIPATH-OrganizationUnitId
To extract the same, one should call 'odata/Folders' API.

Note: GET requests for Robot logs stored using Elasticsearch only retrieve the first 10000 entries. This is due to an Elasticsearch limitation, and it does not occur if you are using SQL.
Using $top and $skip parameters which go beyond the 10000 limit return the following error message: Depth of pagination is limited in Elasticsearch by the max_result_window index setting. Make sure skip + take is lower than 10000.

- Using Postman:
  1. Generate the Bearer token referring to Using OAuth For External Apps document.
  2. Refer to Retrieving Robot Logs According to the Robot Name documentation to start calling Robot logs API(s).
Pre-requisite:
Bearer Token: Steps mentioned above.
X-UIPATH-OrganizationUnitId:To extract the same, one should call 'odata/Folders' API.
  • Extracting logs from Database:
The Robot logs reside in the dbo.logs table and can be extracted using the below approach:
  1. Log in to the Database.
  2. Open a New Query window
  3. Use the below command in case one is looking to extract all the logs from DBO.Logs table:
Select * from [UiPath Database Name].[dbo].[logs]

From the output, Right Click and save the logs in CSV format.

- For Automation Cloud deployment:
  • To export Robot logs generated in the Orchestrator services to Azure, AWS S3, and Google Cloud Storage, see the specific procedures described in Exporting Logs documentation.
  • Extracting logs using API calls(one may use Swagger/Postman):
- Using Swagger:
  1. Log in to Orchestrator.
  2. Open a new tab to open the Swagger: Go to <Orchestrator URL>\Swagger
  3. Refer to Retrieving Robot Logs According to the Robot Name documentation to start calling Robot logs API(s).

Pre-requisite:
X-UIPATH-OrganizationUnitId
To extract the same, one should call 'odata/Folders' API.

Note: GET requests for Robot logs stored using Elasticsearch only retrieve the first 10000 entries. This is due to an Elasticsearch limitation, and it does not occur if you are using SQL.
Using $top and $skip parameters which go beyond the 10000 limit return the following error message: Depth of pagination is limited in Elasticsearch by the max_result_window index setting. Make sure skip + take is lower than 10000.


- Using Postman:
  1. Generate the Bearer token referring to Using OAuth For External Apps document.
  2. Refer to Retrieving Robot Logs According to the Robot Name documentation to start calling Robot logs API(s).
Pre-requisite:
Bearer Token: Steps mentioned above.
X-UIPATH-OrganizationUnitId:To extract the same, one should call 'odata/Folders' API.

1 Like

Hi is there any way we can retrive last log of a robot and subtract with the atual hour and date. I have a robot and is erros is that is not going to get the logs is getting the time that e gets the log of the robot.
Ex: robot 1 last log was 13:27:43 and the robot that is getting the last log retrives de hour 15:41:23. Not the hour of the last log.