Sponsored Content
Special Forums UNIX and Linux Applications Infrastructure Monitoring Can someone run this .awk script? Post 302451004 by Review on Sunday 5th of September 2010 08:18:08 AM
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..
 

9 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

9. 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
UNKNOWN(1)						      General Commands Manual							UNKNOWN(1)

NAME
unknown - identify possible genotypes for unknowns SYNOPSIS
A program to rapidly identify which genotypes are possible for individuals typed as unknowns in the input pedigree. unknown [ -cl ] DESCRIPTION
unknown infers possible genotypes and mating combinations for parents with unknown genotypes for ilink(1), mlink(1) and linkmap(1). OPTIONS
-c Use conditional allele frequencies. -l Choose a good set of loop breakers automatically. RETURN VALUE
0 Successful completion ERRORS
10 File not found 255 Failure EXAMPLES
Normally, unknown(1) is run immediately prior to its sister programs, ilink(1), mlink(1) and linkmap(1), like this: unknown mlink FILES
unknown(1) reads the two files pedfile.dat and datafile.dat as its own input and produces various temporary files that are used as input to the next program. These temporary files are ipedfile.dat, upedfile.dat, speedfile.dat and newspeedfile.dat. NOTES
unknown(1) is part of the FASTLINK package, which is a re-implementation of the LINKAGE suite of computer tools that help investigate genetic linkage as first proposed G.M. Lathrop, J.M. Lalouel, C. Julier, and J. Ott. AUTHORS
Dylan Cooper, Alejandro Schaffer, and Tony Schurtz based on work originally by Jurg Ott, Ph.D, et. al. This manual page was written by Elizabeth Barham <lizzy@soggytrousers.net> for the Debian GNU/Linux system (but may be used by others). WORD-WIDE-WEB http://www.ncbi.nlm.nih.gov/CBBResearch/Schaffer/fastlink.html SEE ALSO
ilink(1), linkmap(1), lodscore(1), mlink(1). April 15, 2003 UNKNOWN(1)
All times are GMT -4. The time now is 08:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy