Is there a command I can give in terminal to remove all rules at once in firewall, mangle, logging etc. etc.?
Is there also a commandt to remove for instance rule 17 to 33? (so more then 9)
Now lines have to removed one by one or by mentioning them explicit with a max. of 9 and no more at once than actually exist.
Example:
I am making a setup script that in general removes all logging and firewall rules and than build the lines I want.
Now I have to do:
/ system logging
pr
rem 0,1,2,3,4
But if the logging only has 2 or 3 rules this command is not performed.
Since it is never sure how many rules already are written I have to do each time a manual remove…
Sorry fewi, maybe after some time I will start to understand, but for the time being to me this is the same as a Chinese just learned the first English trying to explain me how to make bread…
“remove” I can understand, I use it in given example as “rem”
But the [find] part…
Wiki Manual: find :
:find return position of substring or array element
To me it is all acadabra.
probably means I have to fill in an argument. But which in this case? And do I use the “<” and “>” parameters?
“”? What does this mean? To start what? What to fill in here? Why do I need that? I already start a command by hitting the enter button?
“return position of substring or array element” ??? I stand better change to make that bread.
From the given Wik manual example I presume I have to fill in some value in-between the hooks embedded with " " and have to start with the word “find”. But what then? And what to put in-between these " "?
Something like “all”???
All I want is to erase all present unknown numbers of my /system logging output.
I have to do this on 250+ units so it would be easy to catch it in a script I can just past into each units terminal to have it done.
In plain words my command would read:
“erase all lines in /system logging print output and set new one(s)”
How to set the new ones is clear to me, but how to remove the old ones… (in a smart way…!)
I gave the literal command. “remove [find]” as is deletes all entries. “find” can be used for string operations, which is the manual part you found. “find” can also be used to find items on the CLI. “remove [find comment=“test”]” deletes all items that have a comment of “test”. “/ip firewall filter { remove [find chain=“input”] }” deletes all firewall filters in the input chain. “/ip firewall nat { remove [find] }” deletes all NAT rules.
“/system logging { remove [find] }” deletes all logging entries. You can split it in two as “/system logging; remove [find]”.
Now that is what I call a helpful answer.
Now, for a guy with so much karma you might know the answer of the following, related:
If I set in the log to print certain message to a file on disk, and I download that file in my PC all lines in that text file have no ´return´. So it is one big soup of text…
Do you have an idea how to edit the output of the log in a way that the log files are printed in the file with returns?
After all, in the console window they do have a return…
(I can download the file into a text editor and with search and replace try to fix it but since I have to separate two words from the search string into two separated by a ´return´ (which is an ´enter´ in most editors) this is not possible. )
hmm, it works in wordpad and ms-word I just found out…
But it doesn’t work in Notepad. Not in a windows7 system nor XP.
Which is frustrating since the file comes as a .txt file and I hate wordpad and ms-word is a bit ´heavy´.
There are other light, decent text editors for Windows out there. Or - tongue in cheek - use a real computer. UNIX based machines open UNIX line ending text files just fine by default…