Community discussions

MikroTik App
 
cicserver
Member
Member
Topic Author
Posts: 303
Joined: Sun Jul 24, 2011 12:04 pm

print specific value from command output

Mon Sep 14, 2015 1:03 pm

how can i get specific value only from the command ?
Example i want to get only IP address of radius server from this command
/radius print
admin@TEST] > rad print 
Flags: X - disabled 
 #   SERVICE              CALLED-ID             DOMAIN             ADDRESS                                             SECRET            
 0   ;;; radius
     ppp                                                           1.2.3.4                                     radsecret
i want to print value of 1.2.3.4 only. (actually ip changes frequently so i want a command to get the ip)
 
User avatar
aacable
Member
Member
Posts: 435
Joined: Wed Sep 17, 2008 11:58 am
Location: ISLAMIC Republic of PAKISTAN
Contact:

Re: print specific value from command output

Mon Sep 14, 2015 1:16 pm

Try following
:put [get 0 value-name=address]
It will print the value 1.2.3.4 only. (considering you have only single radius configured and its value is 0, other wise if you have multi radius mentioned you can use the number like 1,2,3, etc accordingly)
8)

Who is online

Users browsing this forum: necropastor and 15 guests