Sponsored Content
Full Discussion: awk help urgent
Top Forums UNIX for Dummies Questions & Answers awk help urgent Post 302172734 by rysh on Tuesday 4th of March 2008 03:55:10 PM
Old 03-04-2008
Woow thanks, That was wonderful..


iam trying to run it .. do i have to save the below code as sh


> outfile1
> outfile2
awk -F'|' ' BEGIN {OFS="|"}
{
print $1,$2,$3 >> "outfile1"
print $1,$4 >> "outfile2"
print $1,$5 >> "outfile2"
print $1,$6 >> "outfile2"
} ' filename

btw what does > outfile1 and outfile2 do??

Thanks Again
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help me for AWK URGENT

i have a record like 1,23423,4545,6767,89898,3434,121212,123123,322 2,23233,3434,4545,56566,rxrx,e344343,343434,3434 1,23223,336,78787,78787,654,6767677,6877989,7878 i want to check the $6 field if its start with any letters, i want to move this record to some other file and keep rest of... (2 Replies)
Discussion started by: readycpbala
2 Replies

2. Shell Programming and Scripting

Urgent - Looping using AWK

Hi I have a file which is having following text. The file is in a tabular form with 5 fields. i.e field1, field2 ..... field5 are its columns and there are many rows in it say COUNT is the number of rows Field 1 Field2 Field3 Field4 Field5 ------- ------- ... (8 Replies)
Discussion started by: skyineyes
8 Replies

3. Shell Programming and Scripting

Urgent!!!!! AWK

Thank everyone advanced. Would you please tell me how to use the shell variable in the awk body? I try follows but they all do not work, pls kindly help me: 1. str=`cat file2` awk 'BEGIN{print("'"$str"'"}' file1 > file3 2. str=`cat file2` awk 'BEGIN{print(ENVIRON}' file1 > file3 3.... (3 Replies)
Discussion started by: summer_cherry
3 Replies

4. Shell Programming and Scripting

Awk Doubt _ Urgent

Guys I have the file TEST.csv generated after a join of two different files with the same columns: key,string,data,number,key,string,data,number abc,test,020202,3,abc,test,010305,4 abc,level,070202,9,abc,tool,010203,7 def,tool,010101,7,,,, ghi,,,ghi,test,010203,8 I have to generate a... (2 Replies)
Discussion started by: Rafael.Buria
2 Replies

5. Shell Programming and Scripting

XML Awk : Urgent

Hi All, I am a beginner to Unix. So would really appreciate if people out here can help me out. I have a XML file which has a element <NoteData> in which two values DBHA and DAKO. I need to search these in all the XML files in a directory and if found in the XML file then replace the... (3 Replies)
Discussion started by: karansachdeva
3 Replies

6. Shell Programming and Scripting

urgent help awk script

Hi I have a scenario where i have a file name as abcd_To_hfgh.20090456778_1.dat I will get the filename as parameter and i need a string in between second _ and first . i.e i need hfgh in this case. Please help me with the script. This may not be awk script even if it can be... (2 Replies)
Discussion started by: dsdev_123
2 Replies

7. Shell Programming and Scripting

Urgent awk help !!

Hi All,I need to convert following field from a file L2578978CLC/576/116804 => L2578978CLC/00000576/00168304 i have to append Zeros in the third and fourth number after slash / in the above string (total length of number should be 8). means L2578978CLC/576/116804 should be converted to... (3 Replies)
Discussion started by: unknown123
3 Replies

8. Shell Programming and Scripting

awk or sed help urgent

Hello, I have a file with the follwoing pattern: Input file: =========== tcp://xxx:123 8179 YY 1798 YY tcp://abc:2345 not found tcp://swt:4945 7356 QQ tcp://pqr:456 8178 PP 9485 PP 4485 PP (8 Replies)
Discussion started by: uandme2k2
8 Replies

9. Shell Programming and Scripting

Need Urgent help on awk/sed

Hi, Sample Input Table 1 XXXXX YYYYY A 1 2 3 4 5 B 1 2 3 4 5 C 1 2 3 4 5 D 1 2 3 4 5 A 6 7 B 6 7 C 6 7 D 6 7 Table 2 XXXXX YYYYY E 1 2 3 4 5 F 1 2 3 4 5 E 6 7 F 6 7 Table 3 XXXXX YYYYY G 1 2 3 4 5 (4 Replies)
Discussion started by: ravin
4 Replies
ARGUS(8)						      System Manager's Manual							  ARGUS(8)

NAME
argus - audit record generation and utilization system SYNOPSIS
argus [ options ] [ filter expression ] COPYRIGHT
Copyright (c) 2000-2004 QoSient, LLC All rights reserved. DESCRIPTION
Argus is an IP transaction auditing tool that categorizes IP packets which match the boolean expression into a protocol-specific network transaction model. Argus reports on the transactions that it discovers, as they occur. Designed to run as a daemon, argus generally reads packets directly from a network interface, and writes the transaction status information to a log file or open socket connected to an argus client (such as ra(1)). Argus can also read packet information from tcpdump(1) , snoop(1) or NLANR's Moat Time Sequence Header raw packet files. Argus can also be configured to write its transaction logs to stdout. Argus provides access control for its socket connection facility using tcp_wrapper technology. Please refer to the tcp_wrapper distribu- tion for a complete description. OPTIONS
-b Dump the compiled packet-matching code to stdout and stop. This is used to debug filter expressions. -B Only bind to the specified IP address (remote access must be enabled by a non-zero port). -c Generate system pid file. This will cause argus to create a pid file that can be used to control the number of argi running on a sys- tem. The default pid file directory is /var/run, and $ARGUSHOME, when the OS does not suppor /var/run. -d Run argus as a daemon. This will cause argus to do the things that Unix daemons do and return, if there were no errors, with argus running as a detached process. -D <level> Print debug messages to stderr. The higher the <level> the more information printed. Acceptable levels are 1-8. -e <value> Specify the source identifier for this argus. Acceptable values are numbers, hostnames or ip address. -h Print an explanation of all the arguments. -F Use conffile as a source of configuration information. Options set in this file override any other specification, and so this is the last word on option values. -I <number> Specify the <number> of instances that are concurrently allowed. The default is 1. This is impacts the pid file strategy for argus. -i <interface> Specify the physical network <interface> to be audited. The default is the first network interface that is up and run- ning. -J Generate packet peformance data in each audit record. -M <secs> Specify the interval in <secs> of argus status records. These records are used to report the internal status of argus itself. The default is 300 seconds. -m Don't provide MAC addresses information in argus records. -n <directory> Specify the pid file directory. This overrides the default directory location, which is /var/run, or $ARGUSHOME if /var/run is not available. This switch implies the -c switch. -O Turn off Berkeley Packet Filter optimizer. No reason to do this unless you think the optimizer generates bad code. -p Do not set the physical network interface in promiscuous mode. If the interface is already in promiscuous mode, this option may have no effect. Do this to audit only the traffic coming to and from the system argus is running on. -P <portnum> Specifies the <portnum> for remote client connection. The default is to not support remote access. Setting the value to zero (0) will forceably turn off the facility. -r Read from tcpdump(1) , snoop(1) or NLANR's Moat Time Sequence Header (tsh) packet capture files. If the packet capture file is a tsh format file, then the -t option must also be used. Argus will read from only one input packet file at a time. If the -r option is specified, argus will not put down a listen(2) to support remote access. -R Generate argus records such that response times can be derived from transaction data. -S <secs> Specify the status reporting interval in <secs> for all traffic flows. -t Indicate that the expected packet capture input file is a NLANR's Moat Time Sequence Header (tsh) packet capture file. -U Specify the number of user bytes to capture. -w <file ["filter"] Write transaction status records to output-file. An output-file of '-' directs argus to write the resulting argus- file output to stdout. -X Clear existing argus configuration. This removes any initialization done prior to encountering this flag. Allows you to eliminate the effects of the /etc/argus.conf file, or any argus.conf files that may have been loaded. expression This tcpdump(1) expression specifies which transactions will be selected. If no expression is given, all transactions are selected. Otherwise, only transactions for which expression is `true' will be dumped. For a complete expression format description, please refer to the tcpdump(1) man page. SIGNALS
Argus catches a number of signal(3) events. The three signals SIGHUP, SIGINT, and SIGTERM cause argus to exit, writing TIMEDOUT status records for all currently active transactions. The signal SIGUSR1 will turn on debug reporting, and subsequent SIGUSR1 signals, will increment the debug-level. The signal SIGUSR2 will cause argus to turn off all debug reporting. ENVIRONMENT
$ARGUSHOME - Argus Root directory FILES
/etc/argus.conf - argus daemon configuration file /var/run/argus_os.pid - default PID file nameing convention EXAMPLES
Run argus as a daemon, writing all its transaction status reports to output-file. This is the typical mode. argus -d -e `hostname` -w output-file If ICMP traffic is not of interest to you, you can filter out ICMP packets on input. argus -w output-file - ip and not icmp Argus supports both input filtering and output filtering, and argus supports multiple output streams, each with their own independant fil- ters. If you are interested in tracking IP traffic only (input filter) and want to report ICMP traffic in one output file, and all other IP traf- fic in another file. argus -w outfile1 "icmp" -w outfile2 "not icmp" - ip Audit the network activity that is flowing between the two gateway routers, whose ethernet addresses are 00:08:03:2D:42:01 and 00:00:0C:18:29:F1. Without specifying an output-file, it is assumed that the transaction status reports will be written to a remote client. In this case we have changed the port that the remote client will use to port 430/tcp. argus -P 430 ether host (0:8:3:2d:42:1 and 0:0:c:18:29:f1) & Audit each individual ICMP ECHO transaction. You would do this gather Round Trip Time data within your network. Write the output to out- put-file. argus -R -w output-file "echo" - icmp Audit all NFS transactions involving the server fileserver and increase the reporting interval to 3600 seconds (to provide high data reduc- tion). Write the output to output-file. argus -S 3600 -w output-file udp and port 2049 & AUTHORS
Carter Bullard (carter@qosient.com) SEE ALSO
argus.conf(5), hosts_access(5), hosts_options(5), tcpd(8), tcpdump(1) 10 November 2000 ARGUS(8)
All times are GMT -4. The time now is 04:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy