I was thinking one way to go would be to prefix the comment of all the rules that I want to sync with the text “sync”. So on the source router the script could be
I guess the lack of replies to this thread is because it’s not possible to filter on export.
What about textfile editing? Is it possible to make a script that extracts only some of the lines from the export file into a new file that can be used for import?
What I need is something similar to
cat export.rsc |grep "comment=sync" > import.rsc
So how can the grep functionality be performed in routeros?
I think you’ll need to download the export file to a local system, delete the rules that you don’t need/want either manually or via grep, then upload that to the destination router for import.
Since it seems that the format of the export is basically a script to be executed on the destination, you should be fine with the process outlined above.
Grep, as far as I know, does not exist in ROS, but once you download the file, you can grep it locally, modifying it to your specification for the new device import. That was what I was trying to say above.
I want this to be a script. If I have to do things on my pc in order to run the script, it’s kind of pointless to use a script. Then it would be easier to do all changes on both routers manually.