I'm facing an issue.
Code: Select all
:global ipaddress [/queue simple get 1 target];
:global test [:find $ipaddress "/"];
Thank you for your assistance.
:global ipaddress [/queue simple get 1 target];
:global test [:find $ipaddress "/"];
:global ipaddress [/queue simple get 1 target];
:global test [:global ipaddress; :find $ipaddress "/"];
:global ipaddresses [/queue simple get [find name=queue1] target]
:global ipaddress [:pick $ipaddresses 0 ]
:global cidrmark [:find $ipaddress "/"]
:put "$[:pick $ipaddress 0 $cidrmark]"
{
:local ipaddress ([/queue simple get [find name=queue1] target]->0);
:put "$[:pick $ipaddress 0 [:find $ipaddress /]]"
}
With this solution, I have a result : "$ipaddress"Inside the function, ipaddress is not known so you have refer to it by :global ipaddress.Code: Select all:global ipaddress [/queue simple get 1 target]; :global test [:global ipaddress; :find $ipaddress "/"];
Couple other things too:
- The first line use "get 1", however that's not an *id so it depends on print being called to establish the index of 1. Using "get ([find]->0)" or "get [find name=queue1]" instead avoid needing.
- There can be multiple "target" from "/queue simple get", and :find does not work with arrays & so need use get the 1st element listed as "target" first
For example,Code: Select all:global ipaddresses [/queue simple get [find name=queue1] target] :global ipaddress [:pick $ipaddresses 0 ] :global cidrmark [:find $ipaddress "/"] :put "$[:pick $ipaddress 0 $cidrmark]"
Although these could be a locals and combined:Code: Select all{ :local ipaddress ([/queue simple get [find name=queue1] target]->0); :put "$[:pick $ipaddress 0 [:find $ipaddress /]]" }