# logs

Log file API.
Set management node URL:

# GET /logs

Get a stream of log events.

# Parameters

  • serverintegerFilter by server, omit this to get logs from all servers.
  • servicearrayFilter by systemd unit name, omit this to get logs from all services. The following names are special cased to map to the appropriate unit names: kernel,croit,hagroup,mon,mgr,mds,radosgw,iscsi,smb,osd.*,osd.<id>
  • priorityarrayPriorities to include as syslog levels, 0 = highest, 7 = lowest.
  • afternumberUnix timestamp for the earliest log entry. Required if before is set to a concrete time.
  • beforenumberUnix timestamp for the latest log entry. Set to -1 to follow the log stream. If this is set to a concrete time, then after must also be set.
  • linesintegerMaximum number of lines to return. Will be ignored if an explicit time range is given with before and after. Controls the number of lines to go back from the current time when following a stream (i.e., before == -1), but it will still return more if more events occur.

# Endpoint

curl -X GET http://mgmt-node:8080/api/logs 

# Response 200

  • typeobject-
    • typeNamestring-
  • closedboolean-

# Example response

{
  "type": {
    "typeName": "string"
  },
  "closed": true
}

# GET /logs/logs

Get log events from a server as JSON.

# Parameters

  • serverintegerFilter by server, omit this to get logs from all servers.
  • servicearrayFilter by systemd unit name, omit this to get logs from all services. The following names are special cased to map to the appropriate unit names: kernel,croit,hagroup,mon,mgr,mds,radosgw,iscsi,samba,osd.*,osd.<id>
  • priorityarrayPriorities to include as syslog levels, 0 = highest, 7 = lowest.
  • afternumberUnix timestamp for the earliest log entry. Required if before is set to a concrete time.
  • beforenumberUnix timestamp for the latest log entry.
  • linesintegerMaximum number of lines to return.
  • cursorstringContinue after a given journal cursor as returned by a previous call.

# Endpoint

curl -X GET http://mgmt-node:8080/api/logs/logs 

# Response 200

  • cstringCursor for next requests.
  • tnumberUnix timestamp.
  • mstringLog message.
  • sstringService that generated this message, see o field for further information for OSD services.
  • hintegerId of the host generating this message.
  • pintegerPriority as syslog level, 0 = highest, 7 = lowest

# Example response

[
  {
    "c": "string",
    "t": ,
    "m": "string",
    "s": "string",
    "h": 0,
    "p": 0
  }
]