Community discussions

MikroTik App
 
namo
Long time Member
Long time Member
Topic Author
Posts: 530
Joined: Sat Oct 03, 2009 4:44 pm

print comment of hotspot users in certain profile

Tue Mar 01, 2011 11:24 am

I want to print a list of hotspot users comments from certain profile

I have the code:
/ip hotspot user print where profile="0300kbps" or profile="0600kbps" or profile="0750kbps" or profile="0900kbps" or profile="1200kbps"
but this print many columns. I want just to print the comments
Last edited by namo on Thu Mar 03, 2011 11:51 am, edited 1 time in total.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: print comment of hotspot users in certain profile

Tue Mar 01, 2011 7:28 pm

You can't use print for that. Print prints lists of items, with all their properties. You have to find the items, extract the properties you want, and put them.
:foreach ITEM in=[/ip hotspot user find profile="0300kbps" or profile="0600kbps" or profile="0750kbps" or profile="0900kbps" or profile="1200kbps"] do={
  :local COMMENT [/ip hotpost user get $ITEM comment];
  :put "$COMMENT";
}
 
namo
Long time Member
Long time Member
Topic Author
Posts: 530
Joined: Sat Oct 03, 2009 4:44 pm

Re: print comment of hotspot users in certain profile

Thu Mar 03, 2011 11:49 am

You can't use print for that. Print prints lists of items, with all their properties. You have to find the items, extract the properties you want, and put them.
:foreach ITEM in=[/ip hotspot user find profile="0300kbps" or profile="0600kbps" or profile="0750kbps" or profile="0900kbps" or profile="1200kbps"] do={
  :local COMMENT [/ip hotpost user get $ITEM comment];
  :put "$COMMENT";
}
there is error in the word hotspot in line 2

I didn't get result. I using characters from other language

they appear correctly in Winbox but they don't in the new terminal

Who is online

Users browsing this forum: No registered users and 2 guests