Hello everyone. Well, I will get right to the point. I am new to Perl and trying to learn it as much as I can. I have been assigned the task of writing a perl script to extract information from firewall logs.
Like I said, I am new to Perl and I am having a tough time because I think what I am trying to do is very advanced.
Here is what I want to do:I am trying to extract information from a firewall log and put it into a new file. I only want to extract certain pieces of information. Here are a few examples:
Let me show what I am trying to pull out of the file:
03/13/03 16:44:56 kernel Temporarily blocking host 212.241.116.21
(This is where the inital block occurs, the firewall will then continue to block all attempts from this IP address.I would like to extract all entries in the firewall like this one.)
03/13/03 16:44:57 firewalld103 deny in eth0 48 tcp 20 117 212.241.11.21 209.126.xxx.xxx 4449 80 syn (LO-Proxied-HTTP)
(At this point, the firewall continues to block the attempt. I would like to extract all lines in the firewall that contain this as well...contains very useful information such as ports and packet sizes.)
With that in mind, can I ask for someone to help me build my script? I feel like I am butting my head against a wall. I know I have much to learn, but can learn a lot from seeing the script and breaking it down to see how it functions.
I really need help. If someone can help me write this script, I would be extremely grateful. I should mention, this is not a homework assignment.
Also, once I see the script and how it is written, I believe it will help me understand much more.
Thanks.
Tarballed