Logs
Get Log
Use journalctl to retrieve logs. The parameter descriptions reference sections in man journalctrl.
- Command: GET
-
http://localhost/api/v1/host/logs
Table 1. Parameters Field Type Description unit String Filter logs by the given UNIT (see --unit). priority String Filter the logs by priority (See --priority). useJSON Boolean Format output as JSON (See --output=json). useUTC Boolean Format timestamps in UTC time (See --utc). since String Filter logs before DATE (See --since). until String Filter logs after DATE (See --until). kernel Boolean Filter logs; only show kernel (See --kernel). boot String Filter out logs before the given boot (See --boot). applicationService String Filter logs on APPLICATION SERVICE. lines Integer Number of log lines to print. reverse Boolean Print the newest entries first. Curl examplecurl --unix-socket /var/run/edge-core/edge-core.sock \ http://localhost/api/v1/host/logs?since=1+hour+ago&useUTC=true
Table 2. Success 200 Field Type Description log_text String Log content Success response example{ "log_text": "Nov 28 11:04:40 machine-name kernel: sd 2:0:0:0: [sda] \ Assuming drive cache: write through\\n" }
Table 3. Error 4xx Field Type Description error_message String A description of the error encountered status_code Number The status code for the HTTP request Error response example{ "error_message": "<errorMessage>", "status_code": 400 }