Hi @ghostinthenet,
I got it working - in my case the issue was that the variable immediateGateway was an array. Here is my code:
And the execution:
Hope that it helps.
I got it working - in my case the issue was that the variable immediateGateway was an array. Here is my code:
Code:
{:local immediateGateway [/ip/route get [/ip route find where 8.8.8.8 in dst-address and active and routing-table=main] value-name=immediate-gw] :put [:typeof $immediateGateway]:local immgwstr [:pick $immediateGateway 0]:put ("Where:" . [:tostr [:find $immgwstr "%" 0]]):put ("Raw: ". [:pick $immgwstr ([:find $immgwstr "%" -1] + 1) 64])}
Code:
{{... :local immediateGateway [/ip/route get [/ip route find where 8.8.8.8 in dst-address and active and routing-table=main] value-name=immediate-gw] {... :put [:typeof $immediateGateway]{... :local immgwstr [:pick $immediateGateway 0]{... :put ("Where:" . [:tostr [:find $immgwstr "%" 0]]){... :put ("Raw: ". [:pick $immgwstr ([:find $immgwstr "%" -1] + 1) 64]){... }arrayWhere:10Raw: vlan.4000
Statistics: Posted by vingjfg — Wed Jan 17, 2024 10:18 pm