I’m trying to copy the dhcp lease table into a spreadsheet. I can’t find a way to copy it. Can this be done?
I would run a script that outputs a CSV formatted list that you can copy/paste into a text document, save as myFile.csv, and then open that in Excel.
Example:
/ip dhcp-server lease
:foreach i in=[find] do={
:put ([get $i address].",".[get $i mac-address].",".[get $i client-id].",".[get $i server])
}
To get all the options, I do something like this. Copy/paste this into the terminal:
/ip dhcp-server lease
:foreach i in=[find] do={
:put ([get $i
Then, press TAB a few times until the list of options shows up:
/ip dhcp-server lease> :foreach i in=[find] do={
{... :put ([get $i
active-address agent-circuit-id comment lease-time status
active-client-id agent-remote-id disabled mac-address use-src-mac
active-mac-address always-broadcast dynamic radius value-name
active-server block-access expires-after rate-limit
address blocked host-name server
address-list client-id last-seen src-mac-address
…which you can then use to select which options you want to have in your CSV file. Just edit the first script to include the ones you want.
That is great! Thank you very much. It’s exactly what I was looking for.