/log

Provides access to various logs. Since logs may contain sensitive information, this service is available only to users with the save privilege (see /auth/rights).

Get alert log

Get the alert log. It has a fixed maximum length and consists of a sequence of prioritized and time-stamped entries. When the log fills up, older entries are replaced. Currently up to 50 alert log entries are supported.

SecurityApiKey
Request
query Parameters
after
number

Restricts the method to apply only to those alerts whose last timestamp is newer (younger) than the specified timestamp.

Example: after=1685739455.0433328
acked
boolean

Restrict the method to apply only to those alerts whose acknowledgment status matches the value of this query parameter (true for acknowledged, false for unacknowledged).

ids
Array of integers

Restricts the method to apply only to those alerts whose id is listed in the value of this query parameter.

min_prio
integer [ 0 .. 7 ]

Restrict the method to apply only to those alerts whose priority is at least as high as the value of this query parameter.

Responses
200

Alert log response.

401

Unauthorized response.

get/log/alert
Request samples
Response samples
application/json
{
  • "drops": 0,
  • "log": [
    ],
  • "error": "Error message (present if an error occurred)."
}

Update alert log

Acknowledge all or some alerts.

SecurityApiKey
Request
query Parameters
after
number

Restricts the method to apply only to those alerts whose last timestamp is newer (younger) than the specified timestamp.

Example: after=1685739455.0433328
acked
boolean

Restrict the method to apply only to those alerts whose acknowledgment status matches the value of this query parameter (true for acknowledged, false for unacknowledged).

ids
Array of integers

Restricts the method to apply only to those alerts whose id is listed in the value of this query parameter.

min_prio
integer [ 0 .. 7 ]

Restrict the method to apply only to those alerts whose priority is at least as high as the value of this query parameter.

Request Body schema: application/json
string
Value: "ack"
Responses
200

Status response.

401

Unauthorized response.

post/log/alert
Request samples
application/json
"ack"
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}

Delete alert log

Delete all or some alerts.

SecurityApiKey
Request
query Parameters
after
number

Restricts the method to apply only to those alerts whose last timestamp is newer (younger) than the specified timestamp.

Example: after=1685739455.0433328
acked
boolean

Restrict the method to apply only to those alerts whose acknowledgment status matches the value of this query parameter (true for acknowledged, false for unacknowledged).

ids
Array of integers

Restricts the method to apply only to those alerts whose id is listed in the value of this query parameter.

min_prio
integer [ 0 .. 7 ]

Restrict the method to apply only to those alerts whose priority is at least as high as the value of this query parameter.

Responses
200

Status response.

401

Unauthorized response.

delete/log/alert
Request samples
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}

Get kernel log

Get the kernel log. It has a fixed size and consists of a sequence of prioritized and time-stamped entries. When the log fills up, older entries are replaced.

SecurityApiKey
Request
query Parameters
after
number

Limits the output to messages with a timestamp that is newer than the value specified by this parameter. The value must be a decimal number and may include a fractional part. The number is interpreted as seconds since the epoch. For most logs, the epoch is the Unix epoch (i.e., seconds since the start of Jan 1, 1970 UTC). However, for the kernel log, the epoch is the time the meter was powered up (booted).

Example: after=6.9801816
Responses
200

Kernel log response.

401

Unauthorized response.

get/log/kernel
Request samples
Response samples
application/json
{
  • "log": [
    ],
  • "error": "Error message (present if an error occurred)."
}

Get a Lua log

Get a Lua log. Each log has a fixed size and consists of a sequence of time-stamped entries. When the log fills up, older entries are replaced.

SecurityApiKey
Request
path Parameters
name
required
string

The name of a Lua log. This may be one of:

  • alertd: The log for scripts that are executed when checking for and generating alerts.

  • ctrld: The log for control scripts.

  • teamd: The log for scripts executed while evaluating formula scripts and for calculating costs (tariff script).

Enum: "alertd" "ctrld" "teamd"
query Parameters
after
number

Limits the output to messages with a timestamp that is newer than the value specified by this parameter. The value must be a decimal number and may include a fractional part. The number is interpreted as seconds since the epoch. For most logs, the epoch is the Unix epoch (i.e., seconds since the start of Jan 1, 1970 UTC). However, for the kernel log, the epoch is the time the meter was powered up (booted).

Example: after=6.9801816
Responses
200

Lua log response.

401

Unauthorized response.

get/log/lua/{name}
Request samples
Response samples
application/json
{
  • "log": [
    ]
}

Get system log

Get the system log. It has a fixed size and consists of a sequence of messages. When the log fills up, older messages are replaced. The size of this log can be configured with /config/log/system/size.

SecurityApiKey
Responses
200

System log response.

401

Unauthorized response.

get/log/system
Request samples
Response samples
application/json
{
  • "log": [
    ]
}