You want to use round brackets to capture to $1, not curly brackets. Be sure to copy and paste code instead of retyping in order to avoid typos.
You also need to tell your script what you mean by vfiler0 removal. It sounds like you meant to parse the file as records, not line by line.
Think about how you decide what to keep... in slow motion.
- How far do you get before you're sure you want to ignore stuff?
- What made you decide to start ignoring things? Write a regex to match that.
- Where do you go next from there?
- What rule do you use to stop ignoring stuff?
- There should be a unique way to identify when a new record is starting.
- Write a regex or string comparison to match that.
- If it crosses multiple lines, you will want a variable to track what state your match has reached so far.
- Make an ignore/keep flag to set or clear when you decide to process or ignore the lines as above.
- For each new line, check the flag before looking for IP addresses to print.
Learning to simplify and break down your own thought processes into an algorithm that the computer can follow is a very important skill.