3
3
310th2020-04-28 14:38:07
System administration
310th, 2020-04-28 14:38:07

How to get an IP address from a Mikrotik address sheet via a query from a script?

Friends, comrades, help find a solution.

There is Mikrotik, there are rules for adding sheets to the address: 1, 2, 3, Drop.

Evil people, when they push towards me, end up on sheet 1, on the second attempt, on sheet 2, and so on.

Bottom line: entries in the sheets are duplicated, I want to remove this. I came up with a solution: remove everything that is in the Drop sheet from other sheets.

Question: how to remove the ip address from the address of the sheet in the script, so that we can then go through the rest of the sheets and remove duplicates?

It turns out to take out the entire sheet, but it’s the address that would then find duplicates, it doesn’t work. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
3
310th, 2020-04-29
@310th

He asked, he answered.

:local clearing "/ip firewall address-list\r\n";
    :foreach i in=[/ip firewall address-list print as-value where list=x4rt_Drop] do={
        :set $clearing ("add address=".$i->"address");
    }

D
Dmitry, 2020-04-28
@Tabletko

Why clean up? Add them to the list for a while. Intermediate sheets will be automatically cleared

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question