Page 1 of 1

Need syntax help (interface --> interface list)

Posted: Sun Jun 28, 2020 2:05 pm
by EIKA
Hi all!

This is what I have had and it worked fine:
\n:global txbyte [/interface get [find name=LTE1] tx-byte];\r\

And this is what I trying to do, and it doesn't work:
\n:global txbyte [/interface/list get [find name=Double-WAN-List] tx-byte];\r\

I included LTE1 interface in Double-WAN-List and wanted to get TX byte data for all of interfaces included there. Bad sadly syntax for interface list is incorrect. Because I don't know what is the right syntax - I just tried a few options with trial and error method. And I was not lucky.

Please advise.

Re: Need syntax help (interface --> interface list)

Posted: Sun Jun 28, 2020 5:26 pm
by Jotne
Cut and past this to terminal. Do you get any output.
:put [/interface find name=Double-WAN-List]
If this is ok, try:
:put [/interface/list get [find name=Double-WAN-List]
Post output of
/interface print detail
Edit:

It may be the hyphen - giving problems. Try to rename interface to DoubleWANList

Re: Need syntax help (interface --> interface list)

Posted: Sun Jun 28, 2020 5:44 pm
by EIKA
Thanks, but your advice doesn't help. When I copy/paste your command to terminal, it returns nothing. If I change name to physical interface, it returns number with asterisk (like *8). I think that problem is in we search through interfaces, but must search through interface lists. This is 2 different beasts.

Dash is absolutely OK for MikroTik and widely used everywhere in console commands.

Re: Need syntax help (interface --> interface list)

Posted: Sun Jun 28, 2020 8:00 pm
by Jotne
There is an error.
wrong:
:put [/interface/list get [find name=Double-WAN-List]
correct
:put [/interface get [find name="Double-WAN-List]" ] tx-byte]
No list and double quote.

Re: Need syntax help (interface --> interface list)

Posted: Mon Jun 29, 2020 12:11 am
by EIKA
Thank you very much!