Summary
AlertList and AuditLogList return a negative sentinel value in the total field instead of an exact count. elm's -C/--total flag reads this field directly, so elm AlertList -C previously printed a confusing negative number (e.g. -51).
Behaviour
$ elm AlertList -C
-51
$ elm DeviceList -C
1558
The LM API returns total: -(n_returned + 1) when it cannot compute an exact count. With default size 50, AlertList returns total: -51.
Root cause
This is an LM API behaviour: the total field in /alert/alerts responses is a negative sentinel, not a real count. DeviceList and most other endpoints return real positive totals.
Fix (v1.8.1)
elm now detects negative totals and shows a lower bound with a warning:
$ elm AlertList -C
Warning: total records unknown, there is data you are not seeing.
>50
Workaround for a real count (accurate when total ≤ 1000): elm AlertList -c -s0
Affected endpoints
Confirmed: AlertList, AuditLogList. Tested all 59 *List endpoints — all others return exact totals.
Summary
AlertListandAuditLogListreturn a negative sentinel value in thetotalfield instead of an exact count. elm's-C/--totalflag reads this field directly, soelm AlertList -Cpreviously printed a confusing negative number (e.g.-51).Behaviour
The LM API returns
total: -(n_returned + 1)when it cannot compute an exact count. With default size 50, AlertList returnstotal: -51.Root cause
This is an LM API behaviour: the
totalfield in/alert/alertsresponses is a negative sentinel, not a real count.DeviceListand most other endpoints return real positive totals.Fix (v1.8.1)
elm now detects negative totals and shows a lower bound with a warning:
$ elm AlertList -C Warning: total records unknown, there is data you are not seeing. >50Workaround for a real count (accurate when total ≤ 1000):
elm AlertList -c -s0Affected endpoints
Confirmed:
AlertList,AuditLogList. Tested all 59*Listendpoints — all others return exact totals.