09-21-2010
Help with filtering trace file through grep
Hi,
I am using NS2 and i need to filter a trace file (part of which is shown below):
- 33.91576 2 3 tcp 1040 ------- 1 0.0 4.0 1115 2258
r 33.918907 4 3 ack 40 ------- 1 4.0 0.0 1107 2272
+ 33.918907 3 2 ack 40 ------- 1 4.0 0.0 1107 2272
- 33.918907 3 2 ack 40 ------- 1 4.0 0.0 1107 2272
r 33.9192 2 0 ack 40 ------- 1 4.0 0.0 1103 2264
+ 33.9192 0 2 tcp 1040 ------- 1 0.0 4.0 1123 2275
- 33.9192 0 2 tcp 1040 ------- 1 0.0 4.0 1123 2275
r 33.93256 2 3 tcp 1040 ------- 1 0.0 4.0 1111 2250
+ 33.93256 3 4 tcp 1040 ------- 1 0.0 4.0 1111 2250
- 33.93256 3 4 tcp 1040 ------- 1 0.0 4.0 1111 225
........................
The file needs to be filtered such that column number 3 should only contain "3" and column number 1 should only contain "r" using GREP (or awk).
Any help is greatly appreciated!
10 More Discussions You Might Find Interesting
1. Programming
I am using gdb to examine a core file but the output contains only the method addresses in hex.
Is there anyway to translate these addresses to a human-readable form? :confused: (0 Replies)
Discussion started by: ciregbu
0 Replies
2. AIX
I need write a script to trace filesystem size change, such as /home will increase some size and then release some space. I don't know when increase happen. I want to get the size before increase and the size after release. How to write this script? (1 Reply)
Discussion started by: rainbow_bean
1 Replies
3. UNIX for Dummies Questions & Answers
I have a list of directories looking something like;
/usr/local/1/in
/usr/local/1/out
/usr/local/1/archive
/usr/local/2/in
/usr/local/2/out
/usr/local/2/archive
/usr/local/3/in
/usr/local/3/out
/usr/local/3/archive
Is there a way I can filter the out and archive directories so I... (5 Replies)
Discussion started by: JayC89
5 Replies
4. Shell Programming and Scripting
I'm working on writing a shell script that logs out whenever I have a firefox process running during certain times of the day (1 am - 8 am). I'll put it in crontab when it runs properly unless someone knows of a different and better way to do this. Here it is so far.
if ps ax | grep... (4 Replies)
Discussion started by: cokedude
4 Replies
5. Shell Programming and Scripting
hallow all i have question about awk i want indexing last key (in BOLD number)
ex: input.txt
1
252468812
52468812
1281268819
1252468812
1252468923
468812
1252468812
so output will like this
output text
1:252468812
2:52468812
4:1252468812
6:468812
7:1252468812
output get... (8 Replies)
Discussion started by: zvtral
8 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I am looking for an awk script which should help me to meet the following requirement:
File1 has records in following format
INF: FAILEd RECORD AB1234
INF: FAILEd RECORD PQ1145
INF: FAILEd RECORD AB3215
INF: FAILEd RECORD AB6114
............................ (2 Replies)
Discussion started by: mintu41
2 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I am on
uname -a
HP-UX mymachine B.11.31 U ia64 3223107173 unlimited-user license
ps -exx| grep java | grep -i "GrafiteEventsInterfaces*"
19955 ? 55:22 /opt/app/app1/jdk150_07/bin/IA64N/java -server -Xms1024m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m... (2 Replies)
Discussion started by: mohtashims
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am an oracle DBA pretty new to unix. We had one of the filesystems full and a colleague cleared some stuffs to create more space. I just checked now and found there is now more space available. How do i find exactly what he cleared? We have oracle database installed and its a RAC... (4 Replies)
Discussion started by: dollypee
4 Replies
9. UNIX for Beginners Questions & Answers
+ 8.00747 /NodeList/0/DeviceList/0/$ns3::PointToPointNetDevice/TxQueue/Enqueue ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 0 protocol 17 offset (bytes) 0 flags length: 540 10.1.3.3 > 10.1.2.4) ns3::UdpHeader (length: 520 49153 >... (11 Replies)
Discussion started by: Nipa
11 Replies
10. UNIX for Beginners Questions & Answers
I will initiate a process from Server1 and the flow is as follow
Server1 --> Web server --> Application server --> DB Server
Note all seperate unix servers.
Now I need to put a trace for that process to track the timings from each server.
Like the below trace should be there:
... (5 Replies)
Discussion started by: saraperu
5 Replies
trace(5) File Formats Manual trace(5)
Name
trace - system call tracer device
Description
The file is the system call trace device. It supports the following system calls: and The device supports 16 (configurable in as TR_USRS)
simultaneous users. It uses an 8192-byte buffer for trace records. The choice of which system calls to trace is done with the system call.
The call is used for efficient reading of the device. The call uses an 8192-byte buffer and returns when the buffer is 60% full. It is
required that the user use a buffer the same size as the system buffer size defined in as TR_BUFSIZE. All operations are defined in the
header file, The calls are:
--------------------------------
ioctl arg (pointer to)
--------------------------------
IOTR_GETOFF int a
IOTR_GETON int a
IOTR_GETALL int a
IOTR_GETPIDS int a[10]
IOTR_GETUIDS int a[10]
IOTR_GETSYSC int a[10]
IOTR_GETPGRP int a[10]
IOTR_SETOFF int a
IOTR_SETON int a
IOTR_SETALL int a
IOTR_SETPIDS int a[10]
IOTR_SETUIDS int a[10]
IOTR_SETSYSC int a[10]
IOTR_SETPGRP int a[10]
--------------------------------
Examples
A prototype example (with missing parts):
char cmd[BUFSIZ],buf[TR_BUFSIZ];
int pgrp[10],i;
fd = open("/dev/trace",0); /* open the device */
pgrp[0] = dofork(cmd); /* fork the command to trace */
for (i=1;i<TR_PGRP;i++) /* dofork sleeps 2 seconds while */
pgrp[i] = 0; /* we set up to do the trace */
i = ioctl(fd,IOTR_SETPGRP,pgrp);/* set up for the trace */
/* select code goes here */
read(fd,buf,sizeof(buf));
See Also
trace(1), close(2), ioctl(2), open(2), read(2), select(2)
trace(5)