Sponsored Content
Full Discussion: need help writing a script
Top Forums Shell Programming and Scripting need help writing a script Post 35376 by tarballed on Wednesday 9th of April 2003 06:28:51 PM
Old 04-09-2003
need help writing a script

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. Smilie

Also, once I see the script and how it is written, I believe it will help me understand much more.

Thanks.

Tarballed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Writing Script?

Anyone have an example of a simple shell script that solicits a (Y)es or (N)o response from the user. If the response is 'Y' display a message on the screen that thanks the user for the positive response. If the response is 'N' display a message that thanks the user for the negative response. If... (15 Replies)
Discussion started by: wmosley2
15 Replies

2. UNIX for Dummies Questions & Answers

help for writing a script

Hi, I need help writing a unix script to change the time in the server automatically when it reaches a specified time. Only on the 14th of april, when the time becomes midnight (00:00:00), I need the server to change the time automatically to 23:30:00 and start working on as usual with a... (2 Replies)
Discussion started by: amodha
2 Replies

3. Shell Programming and Scripting

help writing script

hi all i am having a file(a fixed length file) of 28 bytes.The file has account number from 5th place to next 16 digits. the file looks like below, 58331600563588885696ACXT5263 58331600563588885697ACXT5263 58331600563588885698ACXT5263 i want to write a script which will extract the... (8 Replies)
Discussion started by: dr46014
8 Replies

4. UNIX for Dummies Questions & Answers

Need help writing this script

Here is the script I am trying to write along with my answer I wrote. Please help me understand why it doesn't work. Create an executable script file called "newname" that will perform the followings: 1. Rename a file upon the user's request. If the file exists, prompt the user for... (1 Reply)
Discussion started by: wiggles
1 Replies

5. Shell Programming and Scripting

Help me in writing the script

Hi, I have written a script which converts a give hexdecimal value to binary value in perl. But now, the problem is I should read every bit of it ( if its 10101010, i should read the value in each position and if the value in that position is 1 i should print a string and should exit if its... (1 Reply)
Discussion started by: prakashreddy
1 Replies

6. Shell Programming and Scripting

Please help me in writing my script

hello all, I have a script, used to search for the strings from the set of 5 similar pattern file from the log dir. So here it goes . The input parameter is a part of the file name. When during the script execution, the script should parse the input parameter to original file's with the same... (0 Replies)
Discussion started by: baraghun
0 Replies

7. Red Hat

writing a script

Dear Madam/Sir Who can help me with writing a script doing the following? 1- Read names of files (only files with special name format let say initially they have the same file name start like TT*) 2- Then create an empty files with the same names have been read in step one but with extension... (1 Reply)
Discussion started by: m.nageeb
1 Replies

8. Shell Programming and Scripting

Help in writing script

i need some help in donig some actions on files in a library. i want to get the n last files, and print to the screen their name, date, and how many times a specific string appears in each file.. how can i do this..?... (6 Replies)
Discussion started by: eee
6 Replies

9. Shell Programming and Scripting

I need help writing this script

:wall: Can't seem to figure out how to fix this please help its not starting over like I would like it to When I enter in "Date" or "Time" nothing comes Also if you can tell me the commands for the other 3 stuff that would be much appreciated #!/bin/bash clear while ; do echo... (8 Replies)
Discussion started by: nowruzr
8 Replies

10. How to Post in the The UNIX and Linux Forums

Help with script writing?

I am new for script writing. I have a file named as name.dat and contain numbers with different rows and columns. I want to sum numbers at one row with that of at another row; like row1 + row101 + row 201, with corresponding columns. Any one can help me to write a script for this operation. ... (1 Reply)
Discussion started by: kumnegert
1 Replies
fwb_pf(1)							 Firewall Builder							 fwb_pf(1)

NAME
fwb_pf - Policy compiler for OpenBSD packet filter "pf" SYNOPSIS
fwb_pf [-vVx] [-d wdir] [-o output.fw] [-i] -f data_file.xml object_name DESCRIPTION
fwb_pf is a firewall policy compiler component of Firewall Builder (see fwbuilder(1)). This compiler generates code for OpenBSD Packet Fil- ter (pf). Compiler reads objects definitions and firewall description from the data file specified with "-f" option and generates pf con- figuration files and firewall activation script. All generated files have names that start with the name of the firewall object. Firewall activation script has extension ".fw" and is sim- ple shell script that flushes current policy, loads new filter and nat rules and then activates pf. PF configuration file name starts with the name of the firewall object, plus "-pf.conf". NAT configuration file name also starts with the name of the firewall object, plus "-nat.conf". For example, if firewall object has name "myfirewall", then compiler will create three files: "myfirewall.fw", "myfirewall- pf.conf", "myfirewall-nat.conf". The data file and the name of the firewall objects must be specified on the command line. Other command line parameters are optional. OPTIONS
-f FILE Specify the name of the data file to be processed. -o output.fw Specify output file name -d wdir Specify working directory. Compiler creates firewall activation script and PF configuration files in this directory. If this parameter is missing, then all files will be placed in the current working directory. -v Be verbose: compiler prints diagnostic messages when it works. -V Print version number and quit. -i When this option is present, the last argument on the command line is supposed to be firewall object ID rather than its name -x Generate debugging information while working. This option is intended for debugging only and may produce lots of cryptic messages. NOTES
Support for PF has been introduced in version 1.0.1 of Firewall Builder Supported features: o both pf.conf and nat.conf files are generated o negation in policy and NAT rules o grouping in "from", "to" and ports using '{' '}' syntax o if checkbox "Scrub" is checked in the rule options dialog, and rule's action is Accept, the compiler generates two (almost) identi- cal rules: first with action 'scrub' and the second with action 'pass quick' o stateful inspection in individual rule can be turned off in rule options dialog. By default compiler adds "keep state" or "modulate state" to each rule with action 'pass' o rule options dialog provides a choice of icmp or tcp rst replies for rules with action "Reject" o compiler adds flag "allow-opts" if match on ip options is needed o compiler can generate rules matching on TCP flags o compiler can generate script adding ip aliases for NAT rules using addresses that do not belong to any interface of the firewall o compiler always adds rule "block quick all" at the very bottom of the script to ensure "block all by default" policy even if the policy is empty. o Address ranges in both policy and NAT Features that are not supported (yet) o custom services What will not be supported (at least not anytime soon) o policy routing URL
Firewall Builder home page is located at the following URL: http://www.fwbuilder.org/ BUGS
Please report bugs using bug tracking system on SourceForge: http://sourceforge.net/tracker/?group_id=5314&atid=105314 SEE ALSO
fwbuilder(1), fwb_ipt(1), fwb_ipf(1) FWB
fwb_pf(1)
All times are GMT -4. The time now is 12:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy