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
ARP2ETHERS(8)						      System Manager's Manual						     ARP2ETHERS(8)

NAME
arp2ethers - convert arpwatch address database to ethers file format SYNOPSIS
arp2ethers DESCRIPTION
arp2ethers converts file arp.dat in the current directory into ethers(5) format on stdout. Usually arp.dat is an ethernet/ip database file generated by arpwatch(8). The arpwatch daemon in Debian will create different arp.dat depending on its configuration. All of them will be available at /var/lib/arpwatch/. FILES
/var/lib/arpwatch - default directory for arp.dat arp.dat - ethernet/ip address database SEE ALSO
arpwatch(8), ethers(5), rarp(8), arp(8), BUGS
Please send bug reports to arpwatch@ee.lbl.gov. AUTHORS
Original version by Craig Leres of the Lawrence Berkeley National Laboratory Network Research Group, University of California, Berkeley, CA. Modified for the Debian Project by Peter Kelemen, with additions from Erik Warmelink. The current version is available via anonymous ftp: ftp://ftp.ee.lbl.gov/arpwatch.tar.gz This manual page was contributed by Hugo Graumann. ARP2ETHERS(8)
All times are GMT -4. The time now is 09:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy