Can someone run this .awk script?

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Infrastructure Monitoring Can someone run this .awk script?
# 1  
Old 09-05-2010
Can someone run this .awk script?

Hi I'm new to do community and I've joined because I need a little help.

I'm working a on a school project and I am currently stuck because I must count number of protocol packets from wireshark .pcap file and in order to so I found this .awk script.

Code:
BEGIN {
}
{
vrijeme = $2;
if ($5 == "TCP"){
printf("%.5f %d\n", vrijeme, 1040) >> "obrada.dat";
}

if ($5 == "DNS"){
printf("%.5f %d\n", vrijeme, 2000) >> "obrada.dat";
}

if ($5 == "SNMP"){
printf("%.5f %d\n", vrijeme, 1040) >> "obrada.dat";
}

if ($5 == "SMB"){
printf("%.5f %d\n", vrijeme, 1040) >> "obrada.dat";
}

if ($5 == "UDP"){
printf("%.5f %d\n", vrijeme, 1500) >> "obrada.dat";
}

if ($5 == "ICMP"){
printf("%.5f %d\n", vrijeme, 1040) >> "obrada.dat";
}

if ($5 == "NBSS"){
printf("%.5f %d\n", vrijeme, 1040) >> "obrada.dat";
}

if ($5 == "HTTP"){
printf("%.5f %d\n", vrijeme, 1040) >> "obrada.dat";
}

if ($5 == "TNS"){
printf("%.5f %d\n", vrijeme, 1040) >> "obrada.dat";
}

if ($5 == "LDAP"){
printf("%.5f %d\n", vrijeme, 1040) >> "obrada.dat";
}

if ($5 == "CLDAP"){
printf("%.5f %d\n", vrijeme, 1040) >> "obrada.dat";
}


}

END {

}

Then I have spent 2 hours trying to run this script on a selected file (via MATLAB, gawk etc) and I didn't succeed.

So I figured out that it would be very much easier for me if some else (more experienced .awk user) could run script for me and just post resulting file here.

I uploaded wireshark file (20MB) on
<link removed>

Thanks in advance.

Last edited by Scott; 09-05-2010 at 10:11 AM..
# 2  
Old 09-05-2010
Which layer protocols are you interested in?
# 3  
Old 09-05-2010
I'm interested in protocols from third layer and onward. More precisely all protocols I'm looking for are listed in .awk script and I have to have them listed in txt file exactly as the script says.
# 4  
Old 09-05-2010
Please find another way of getting the information you need without posting links to such websites.

Post it in the Homework forum, using the correct template.

Last edited by Scott; 09-05-2010 at 10:13 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

3. Shell Programming and Scripting

Run awk script on windows?

Hi , I am struck with one problem here. I have awk script which deals with a log file and gives result. It works perfect on linux. But my problem is I want to run it on windows. How I can run my awk script on windows? Please guide me on this. how to proceed further? Thanks pamu (5 Replies)
Discussion started by: pamu
5 Replies

4. Shell Programming and Scripting

Awk script to run a sql and print the output to an output file

Hi All, I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file. Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies

5. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

6. Homework & Coursework Questions

Can someone run this .awk script?

NOTE: I'm not asking that someone do my project for me nor do I need help with logical part of my homework assignment. I just need someone to run the script on a wireshark file and send me output file. This requires 1min of time from experienced awk user and for me it's pain of learning how to... (2 Replies)
Discussion started by: Review
2 Replies

7. AIX

My script didn't run every run every minute at cronjob

In my cronjob, I would like to schedule my script.sh to run every minutes. I crontab -e and have in line below but it didn't seems to run at all. * * * * * script.sh When I run it manually, I can run it. Is that anything wrong with the above line? If I change it to something like below,... (4 Replies)
Discussion started by: ngaisteve1
4 Replies

8. UNIX for Dummies Questions & Answers

how to run script from awk

Hi Friends, I'm trying to retrigger a script if the IN_FILE is empty(except the first line) how many I do this? script need to be retriggered: /local/temp/scriptex.ksh right now I have awk '{if ($2 == "") {cd /local/temp ./scriptex.ksh}}' $IN_FILE but doesn't work Thanks (2 Replies)
Discussion started by: UNovIX
2 Replies

9. Shell Programming and Scripting

Run Shell Script into AWK

Hi Guys.. How to run a Shell Script into AWK instruction :confused::confused: (3 Replies)
Discussion started by: gandarez
3 Replies
Login or Register to Ask a Question