Logs
- Get all logs
- Get 20 logs from a cursor position
- Get logs for a node
- Get 20 logs from a cursor position for a node
- Get logs for a node family
- Get 20 logs from a cursor position for a node family
- Search in logs
- Get 20 logs from a cursor position for the search query
- Get all log originators
- Get log originators for a node
- Get log originators for a node family
- Get log levels for a node
- Set log level for current node
- Get part of a log message
Get all logs
Section titled “Get all logs”Retrieve the latest log entries for all managed nodes.
Definition
Section titled “Definition”GET /api/logs?originator=ORIGINATOR&after_date=AFTER_DATE_AND_TIME&tags=LISTOFTAGSExample requests
Section titled “Example requests”curl -X GET "http://127.0.0.1:8080/api/logs" -u admin:PASSWORD
curl -X GET "http://127.0.0.1:8080/api/logs?originator=alarm" -u admin:PASSWORD
curl -X GET "http://127.0.0.1:8080/api/logs?after_date=2015-11-25T13:58:38.345Z" -u admin:PASSWORD
curl -X GET "http://127.0.0.1:8080/api/logs?tags=dev,critical" -u admin:PASSWORDExample response
Section titled “Example response”{ "logs": [ { "date": "1406817800759", "severity": "warning", "originator": "System monitor", "nodeId": "298548c9-f5f8-464d-9a2c-07d494c3ecd4", "nodeName": "wombat@127.0.0.1", "message": "Long schedule time <0.19954.0>[{timeout,307},\n {in,{folsom_ets,notify,1}},\n {out,{wo_metrics_graphite_ch,send_to_carbon,1}}]", "type": "logEvent" }, { "date": "1406817800452", "severity": "warning", "originator": "System monitor", "nodeId": "298548c9-f5f8-464d-9a2c-07d494c3ecd4", "nodeName": "wombat@127.0.0.1", "message": "Long schedule time <0.19954.0>[{timeout,158},{in,{folsom_metrics,notify,1}},{out,{folsom_ets,notify,1}}]", "type": "logEvent" }, {...}, {...}, {...} ], "cursor" : "HnOk2fFJCPRM24T3tr0up2Kg/WuDbAAAAAFqaAJoA2IAAAfeYQphH2EY"}Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| originator | Optional. Filter the logs by this field’s value. |
| originator[] | Optional. Multiple originators can be supplied through this parameter. |
| not_originator[] | Optional. The supplied originators will not beincluded in the returned logs. |
| after_date | Optional. Logs created before this date will be returned. |
| tags | Optional. A comma separated list of tags that overrides the tags set for the user. |
| limit | Optional. A positive integer specifying the maximum number of logs returned. The maximum is 100. |
Returns
Section titled “Returns”An array of the 20 or the limit amount of most recent log entries for all managed nodes, starting with
the newest log entry. Each entry has the following properties: date,
severity, originator, nodeId, nodeName, message, props and
type. A cursor is provided that can be used to enumerate further log entries
(unless it’s null which indicates there are no more results). Possible properties
when the full log message is bigger than 1000 bytes:
- hasNext: there’s enough data in the log message to show on next page
- hasPrev: there’s enough data in the log message to show on previous page
- start: the index of the first byte currently shown. Use the Get part of a log message call to get the rest of the message.
- cursor: contains the cursor of this message.
Get 20 logs from a cursor position
Section titled “Get 20 logs from a cursor position”Retrieve older log entries for all managed nodes.
Definition
Section titled “Definition”GET /api/logs/previous/all?c=CURSOR&originator=ORIGINATOR&after_date=AFTER_DATE_AND_TIME&tags=dev,criticalExample response
Section titled “Example response”See “Get all logs”, above.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| cursor | Required. The cursor returned in the previous call. |
| originator | Optional. Filter the logs by this field’s value. |
| originator[] | Optional. Multiple originators can be supplied through this parameter. |
| not_originator[] | Optional. The supplied originators will not beincluded in the returned logs. |
| after_date | Optional. Logs created before this date will be returned. |
| tags | Optional. A comma separated list of tags that overrides the tags set for the user. |
| limit | Optional. A positive integer specifying the maximum number of logs returned. The maximum is 100. |
Returns
Section titled “Returns”An array of 20 or the limit amount of log entries, starting from the specified cursor position, for all managed nodes. The most recent entries appear first. See “Get all logs”, above, for more details.
Get logs for a node
Section titled “Get logs for a node”Retrieve the latest log entries for a specified node.
Definition
Section titled “Definition”GET /api/logs/node/NODE_ID?originator=ORIGINATOR&after_date=AFTER_DATE_AND_TIME&tags=dev,criticalExample request
Section titled “Example request”curl -X GET "http://127.0.0.1:8080/api/logs/node/3fa56f92-3195-401b-93a8-7bc43e54d66fExample response
Section titled “Example response”See “Get all logs”, above.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| node ID | Required. The node’s identifier. |
| originator | Optional. Filter the logs by this field’s value. |
| originator[] | Optional. Multiple originators can be supplied through this parameter. |
| not_originator[] | Optional. The supplied originators will not beincluded in the returned logs. |
| after_date | Optional. Logs created before this date will be returned. |
| tags | Optional. A comma separated list of tags that overrides the tags set for the user. |
| limit | Optional. A positive integer specifying the maximum number of logs returned. The maximum is 100. |
Returns
Section titled “Returns”Log entries for the specified node and a cursor. See “Get all logs”, above, for more details.
Get 20 logs from a cursor position for a node
Section titled “Get 20 logs from a cursor position for a node”Retrieve older log entries for a specified node.
Definition
Section titled “Definition”GET /api/logs/previous/node/NODE_ID?c=CURSOR&originator=ORIGINATOR&after_date=AFTER_DATE_AND_TIME&tags=dev,criticalExample response
Section titled “Example response”See “Get all logs”, above.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| node ID | Required. The node’s identifier. |
| cursor | Required. The cursor returned in the previous call. |
| originator | Optional. Filter the logs by this field’s value. |
| originator[] | Optional. Multiple originators can be supplied through this parameter. |
| not_originator[] | Optional. The supplied originators will not beincluded in the returned logs. |
| after_date | Optional. Logs created before this date will be returned. |
| tags | Optional. A comma separated list of tags that overrides the tags set for the user. |
| limit | Optional. A positive integer specifying the maximum number of logs returned. The maximum is 100. |
Returns
Section titled “Returns”An array of 20 or the limit amount of log entries, starting from the specified cursor position, for the specified node. The most recent entries appear first. See “Get all logs”, above, for more details.
Get logs for a node family
Section titled “Get logs for a node family”Retrieve the latest log entries for all the managed nodes in a specified node family.
Definition
Section titled “Definition”GET /api/logs/node-family/NODE_FAMILY_ID?originator=ORIGINATOR&after_date=AFTER_DATE_AND_TIME&tags=dev,criticalExample request
Section titled “Example request”curl -X GET "http://127.0.0.1:8080/api/logs/node-family/93be4f01-dae6-49b0-9608-4552f841a720" \ -u admin:PASSWORDExample response
Section titled “Example response”See “Get all logs”, above.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| node family ID | Required. The node family’s identifier. |
| originator | Optional. Filter the logs by this field’s value. |
| originator[] | Optional. Multiple originators can be supplied through this parameter. |
| not_originator[] | Optional. The supplied originators will not be included in the returned logs. |
| after_date | Optional. Logs created before this date will be returned. |
| tags | Optional. A comma separated list of tags that overrides the tags set for the user. |
| limit | Optional. A positive integer specifying the maximum number of logs returned. The maximum is 100. |
Returns
Section titled “Returns”An array of 20 or the limit amount of log entries, starting from the specified cursor position, for the nodes in the specified node family. The most recent entries appear first. See “Get all logs”, above, for more details.
Get 20 logs from a cursor position for a node family
Section titled “Get 20 logs from a cursor position for a node family”Retrieve older log entries for all the managed nodes in a specified node family.
Definition
Section titled “Definition”GET /api/logs/previous/node-family/NODE_FAMILY_ID?c=CURSOR&originator=ORIGINATOR&after_date=AFTER_DATE_AND_TIME&tags=dev,criticalExample response
Section titled “Example response”See “Get all logs”, above.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| node family ID | Required. The node family’s identifier. |
| cursor | Required. The cursor returned in the previous call. |
| originator | Optional. Filter the logs by this field’s value. |
| originator[] | Optional. Multiple originators can be supplied through this parameter. |
| not_originator[] | Optional. The supplied originators will not be included in the returned logs. |
| after_date | Optional. Logs created before this date will be returned. |
| tags | Optional. A comma separated list of tags that overrides the tags set for the user. |
| limit | Optional. A positive integer specifying the maximum number of logs returned. The maximum is 100. |
Returns
Section titled “Returns”An array of 20 or the limit amount of log entries, starting from the specified cursor position, for the nodes in the specified node family. The most recent entries appear first. See “Get all logs”, above, for more details.
Search in logs
Section titled “Search in logs”Retrieve log entries for which all the given criteria hold. The criteria can be defined as a logical conjunction using some filters defined as follows.
q=TEXT: The log message contains theTEXTstring.originator=ORIGINATOR: The originator of the log isORIGINATOR.node=NODEID: The log was collected from nodeNODEID.node-family=NODEFAMILYID: the log was collected from a node belonging to node familyNODEFAMILYID.negate: The log message does not contain the ‘TEXT’ string specified via the ‘q’ parameter.after_date=AFTER_DATE_AND_TIME: The logs that were created afterAFTER_DATE_AND_TIMEwill be returned.tags=LISTOFTAGS: The log entry is tagged with at least one of the given tags.
Definition
Section titled “Definition”GET /api/logs/search?q=TEXT&cs&originator=ORIGINATOR&node=NODEID&node-family=NODEFAMILYID&negate&after_date=AFTER_DATE_AND_TIME&tags=dev,criticalExample requests
Section titled “Example requests”- Retrieves all the log entries that contain the
errorstring in their log message.
curl -X GET "http://127.0.0.1:8080/api/logs/search?q=error" -u admin:PASSWORD-
Retrieves all the log entries that satisfy all the following properties:
- The log message contains the
terminatedstring. - The originator of the log is
lager. - The log was collected from node
cfeae528-d45c-4a9e-8a41-aefa39d0cdef.
- The log message contains the
curl -X GET "http://127.0.0.1:8080/api/logs/search?q=terminated&originator=lager&node=cfeae528-d45c-4a9e-8a41-aefa39d0cdef"-
Retrieves all the log entries that satisfy all the following properties:
- The log message contains the
loadedstring. - The log was collected from any of the nodes belonging to node family
c86645ba-684c-4ca8-a722-cdd51e3ba273.
- The log message contains the
curl -X GET "http://127.0.0.1:8080/api/logs/search?q=loaded&node-family=c86645ba-684c-4ca8-a722-cdd51e3ba273"- Retrieves all the log entries that does not contain the ‘error’ string in their log message.
curl -X GET "http://127.0.0.1:8080/api/logs/search?q=error&negate"Example response
Section titled “Example response”See “Get all logs”, above.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| q | Required. The string to search for. |
| cs | Optional. Do a case sensitive search. |
| originator | Optional. Filter the logs by this field’s value. |
| originator[] | Optional. Multiple originators can be supplied through this parameter. |
| not_originator[] | Optional. The supplied originators will not be included in the returned logs. |
| node | Optional. The identifier of a node. Only those logs are considered that were collected from this node. |
| node-family | Optional. The identifier of a node family. Only those logs are considered that were collected from this node family. |
| negate | Optional. The log message does not contain the TEXT string specified via the q parameter. |
| after_date | Optional. Logs created before this date will be returned. |
| tags | Optional. A comma separated list of tags that overrides the tags set for the user. |
| limit | Optional. A positive integer specifying the maximum number of logs returned. The maximum is 100. |
Returns
Section titled “Returns”An array of the 20 or the limit amount of most recent log entries for which all the given criteria hold. See “Get all logs”, above, for more details.
Get 20 logs from a cursor position for the search query
Section titled “Get 20 logs from a cursor position for the search query”Retrieve older log entries for which all the given criteria hold. The criteria can be defined as a logical conjunction using some filters defined as follows.
q=TEXT: The log message contains theTEXTstring.originator=ORIGINATOR: The originator of the log isORIGINATOR.node=NODEID: The log was collected from nodeNODEID.node-family=NODEFAMILYID: the log was collected from a node belonging to node familyNODEFAMILYID.negate: The log message does not contain theTEXTstring specified via theqparameter.after_date=AFTER_DATE_AND_TIME: The logs that were created afterAFTER_DATE_AND_TIMEwill be returned.tags=LISTOFTAGS: The log entry is tagged with at least one of the given tags.
Definition
Section titled “Definition”GET /api/logs/previous/search?q=TEXT&c=CURSOR&cs&originator=ORIGINATOR&node=NODEID&node-family=NODEFAMILYID&negate&after_date=AFTER_DATE_AND_TIME&tags=dev,criticalExample response
Section titled “Example response”See “Get all logs”, above.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| cursor | Required. The cursor returned in the previous call. |
| q | Required. The string to search for. |
| cs | Optional. Do a case sensitive search. |
| originator | Optional. Filter the logs by this field’s value. |
| originator[] | Optional. Multiple originators can be supplied through this parameter. |
| not_originator[] | Optional. The supplied originators will not be included in the returned logs. |
| node | Optional. The identifier of a node. Only those logs are considered that were collected from this node. |
| node-family | Optional. The identifier of a node family. Only those logs are considered that were collected from this node family. |
| negate | Optional. The log message does not contain the TEXT string specified via the q parameter. |
| after_date | Optional. Logs created before this date will be returned. |
| tags | Optional. A comma separated list of tags that overrides the tags set for the user. |
| limit | Optional. A positive integer specifying the maximum number of logs returned. The maximum is 100. |
Returns
Section titled “Returns”An array of 20 or the specified amount of log entries, starting from the specified cursor position, for which all the given criteria hold. See “Get all logs”, above, for more details.
Get all log originators
Section titled “Get all log originators”Retrieve the list of log originators for all nodes.
Definition
Section titled “Definition”GET /api/logs/originatorExample request
Section titled “Example request”curl -X GET "http://127.0.0.1:8080/api/logs/originator" -u admin:PASSWORDExample response
Section titled “Example response”{ "originators" : [ "Module checker", "Shell", "System monitor", "lager" ]}Arguments
Section titled “Arguments”None.
Returns
Section titled “Returns”An array that contains each originator that can be used for filtering logs.
Get log originators for a node
Section titled “Get log originators for a node”Retrieve the list of log originators for a given node.
Definition
Section titled “Definition”GET /api/logs/originator/node/NODE_IDExample request
Section titled “Example request”curl -X GET "http://127.0.0.1:8080/api/logs/originator/node/3fa56f92-3195-401b-93a8-7bc43e54d66f" -u admin:PASSWORDExample response
Section titled “Example response”See “Get all log originators”, above.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| node ID | Required. The node’s identifier. |
Returns
Section titled “Returns”See “Get all log originators”, above.
Get log originators for a node family
Section titled “Get log originators for a node family”Retrieve the list of log originators for a given node family.
Definition
Section titled “Definition”GET /api/logs/originator/node-family/NODE_FAMILY_IDExample request
Section titled “Example request”curl -X GET "http://127.0.0.1:8080/api/logs/originator/node-family/93be4f01-dae6-49b0-9608-4552f841a720" -u admin:PASSWORDExample response
Section titled “Example response”See “Get all log originators”, above.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| node family ID | Required. The node family’s identifier |
Returns
Section titled “Returns”See “Get all log originators”, above.
Get log levels for a node
Section titled “Get log levels for a node”Retrieve the current log levels for a specified node.
Definition
Section titled “Definition”GET /api/logs/level/NODE_IDExample request
Section titled “Example request”curl -X GET "http://127.0.0.1:8080/api/logs/level/3fa56f92-3195-401b-93a8-7bc43e54d66f" -u admin:PASSWORDExample response
Section titled “Example response”{ "logLevels": [ { "handler": "wo_logs_lager_agent", "logLevel": "warning" }, { "handler": "wo_logs_elogger_agent", "logLevel": "warning" } ]}Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| node ID | Required. The node’s identifier. |
Returns
Section titled “Returns”An array that contains each handler and its current log level for the specified node.
Set log level for current node
Section titled “Set log level for current node”Update the log level for the specified handler on a node.
Definition
Section titled “Definition”POST /api/logs/level/NODE_ID{ "handler": "HANDLER", "level": "SEVERITY"}Example request
Section titled “Example request”curl -X POST "http://127.0.0.1:8080/api/logs/level/3fa56f92-3195-401b-93a8-7bc43e54d66f" \ -H "Content-Type: application/json" \ -d "{\"handler\":\"wo_logs_lager_agent\", \"level\":\"info\"}" \ -u admin:PASSWORDExample response
Section titled “Example response”{}Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| node ID | Required. The node’s identifier. |
| handler | Required. The handler for which to update the log level. |
| level | Optional. The new log level (info, warning, or error). |
Returns
Section titled “Returns”An empty object. If successful, the HTTP response is 200 OK.
Get part of a log message
Section titled “Get part of a log message”If a log message is too big (more than 1000000 bytes), WombatOAM might run out
of memory crash when encoding it to JSON. The web browsers have trouble
displaying this much data too. To avoid these problems, the server only returns
big log messages page by page, when a page contains around 1000 bytes data (might
be 1-3 bytes more to avoid splitting multibyte UTF-8 encoded characters). This
function is used to get these pages. To go through the pages in forward direction,
set the FROM value to the start property and set DIRECTION to next. Set
DIRECTION to prev and you can go backwards within the pages. If DIRECTION
is set to first or last, then the first or last page is returned, regardless
of the FROM value. The hasNext and the hasPrev properties in the result
show if there are any more pages in either direction.
Get first/last/next/previous page (1000 bytes) of a single log message.
Definition
Section titled “Definition”GET /api/logs/previous/part?c=CURSOR&from=FROM&direction=DIRECTIONExample requests
Section titled “Example requests”curl -X GET "http://127.0.0.1:8080/api/logs/previous/part?c=r3jpgnb8hSoMyL9RNkPhTRrsEeaDbAAAAAFqaAJoA2IAAAXXYgADIHZiAA0YHWEU&from=0&direction=next \ -u admin:PASSWORDExample response
Section titled “Example response”{ "logs": [ { "date":"1494850906467", "severity":"error", "originator":"error_logger", "nodeId":"3fcaf6a5-a222-40e0-a708-ef19c4eeb90b", "nodeName":"test_app@127.0.0.1", "message":"187, 94188, 94189, 94190, 94191, 94192, 94193, \n 94194, 94195, 94196, 94197, 94", "props": { "cursor":"r3jpgnb8hSoMyL9RNkPhTRrsEeaDbAAAAAFqaAJoA2IAAAXXYgADIHZiAA0YHWEU", "hasNext":true, "start":1001, "hasPrev":true }, "type":"logEvent", "displayName":"test_app@127.0.0.1" } ], "cursor":null}Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
| cursor | Required. The cursor returned from the previous call. This specifies the log message. |
| from | Required. The index of the byte from where the previous log message part is returned. |
| direction | Required. The direction of the next page. Can be first, prev, next or last. |
