PPP secrets last logged out time in terminal

Hi All

Without dedicated monitoring, sometimes the easiest way to see when something went down is to look at the PPP Secrets page, and look at the “last logged out time”.

The problem with this, is that it can seemingly only be accessed from Winbox.


/ppp secret print

Doesn’t show the last-logged-out column, no matter how wide you space the terminal. If you’re looking for a way to see this last logged out time from terminal, you have to type:


/ppp secret print detail

Hope this helps. Does anyone know of an easy way to choose only specified columns for “print brief” ?

Normally, the whole thing is :put ([/ppp secret print detail as-value where name=xyz]->“last-logged-out”), but it doesn’t work on 6.45.7, so you may want to file a bug with support@mikrotik.com.

So a workaround is this:

:local asValue [:tostr [/ppp secret print detail as-value where name=xyz]] ; :local first ([:find $asValue "last-logged-out" -1]+16) ; :put [:pick $asValue $first ($first+20)]

I find this code clearer:

:put [/ppp secret get [find where name=xyz] last-logged-out ]

get/find is usually simpler to program than using print as-value. It works for retrieving entities, for results such as monitor you still need as-value…

I 100% agree, right now I don’t understand myself why I took the long way, except that I recently was dealing with values available only via monitor once so I forgot for a while that what can be obtained via print detail can be also obtained via get.