Sponsored Content
Top Forums UNIX for Beginners Questions & Answers awk script to find repeated IP adress from trace file (.tr) Post 302992722 by Nipa on Wednesday 1st of March 2017 03:38:04 AM
Old 03-01-2017
1...Operating system is linux and more accurately it is ubuntu 14.0.4 in a virtual environment.

2..I have tried awk script for this. i m displaying code below for it.
Code:
BEGIN {
count = 0;
i=0;

start_time=8.0
}
	{
        	event = $1
		time = $2
		node_id = $19
		source_add = $29
		dest_add = $31


	if (dest_add == "10.1.2.4)" && time="56.0037") {
if(start_time>time){
start_time=time+10.0
}
 
      source[i] = $29
}
print "\n\tSource IP address at time =", source[i],"\n\n";
	i++;
}
}
END {
print "\n\tSource IP address at time =", i, "\n\n";
}

3..I'm working on a trace file to get repeated IP source adresss.

4.. i need output as follow:
No. of repeated source IP and destination pair with time slots.

note: i m using Bourne Again shell (bash)

Last edited by Nipa; 03-01-2017 at 04:41 AM.. Reason: need to answer
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to find a word repeated in a file

Hi everyone, I have a file in which a word is repeated more than one time and I want to know how many times it is repeated. ex: if i repeated word 'guru' in 10 lines I can get the o/p as: cat filename | grep -c 'guru'. How ever if the word is repeated more than one time, then how can I... (4 Replies)
Discussion started by: gurukottur
4 Replies

2. Shell Programming and Scripting

To find the IP adress in the log file

Hi, I need to find out the repeated IP address from the apache log file from my box. I did try to come out with the script, but I could not grep out the repeated Ip Address from the error_logs and need to redirect to a file. Can you guys please help me out of this problem. Thanks in... (9 Replies)
Discussion started by: gsiva
9 Replies

3. Shell Programming and Scripting

To find the repeated name in subject

Hi, I am using a mail application, When I use to check with the command, I will get the outputs as q -s 6128175 (9, 9/6128175) Return-path: minka.bell@abcd.org From: "Minka Bell" <minka.bell@abcd.org> To: <dcrouch@xyz.org>, Subject: Open items with new PICT system Date: Wed,... (12 Replies)
Discussion started by: gsiva
12 Replies

4. Shell Programming and Scripting

Trying to get an IP adress from a file

This is probably a real n00b question but i`m not able to figure it out. I have a folder of configuration files that contain IP-adresses. The line i`m interested in looks like this: IP_ADDRESS="123.123.123.1123" Some have muliple ip adresses, so the line will look like : ... (5 Replies)
Discussion started by: DaneV
5 Replies

5. Shell Programming and Scripting

How to find repeated string in a text file

I have a text file where I need to find the string = ST*850* This string is repetaed several times in the file, so I need to know how many times it appears in the file, this is the text files: ISA*00* *00* *08*925485USNR *ZZ*IMSALADDERSP... (13 Replies)
Discussion started by: cucosss
13 Replies

6. Shell Programming and Scripting

sort file with email adress

Hi All, I have a file which is "|" pipe delimited. The file has 3 fields. the last field contains email ids which has different host names. I want to sort the file based on host name, which is in 3rd filed and needs to create a file for each host. For example, if out of 1000 records, 10... (6 Replies)
Discussion started by: ace_friends22
6 Replies

7. Shell Programming and Scripting

Awk based script to find the median of all individual columns in a data file

Hi All, I have some data like below. Step1,Param1,Param2,Param3 1,2,3,4 2,3,4,5 2,4,5,6 3,0,1,2 3,0,0,0 3,2,1,3 ........ so on Where I need to find the median(arithmetic) of each column from Param1...to..Param3 for each set of Step1 values. (Sort each specific column, if the... (5 Replies)
Discussion started by: ks_reddy
5 Replies

8. Shell Programming and Scripting

awk based script to find the average of all the columns in a data file

Hi All, I need the modification for the below mentioned code (found in one more post https://www.unix.com/shell-programming-scripting/27161-script-generate-average-values.html) to find the average values for all the columns(but for a specific rows) and print the averages side by side. I have... (4 Replies)
Discussion started by: ks_reddy
4 Replies

9. Shell Programming and Scripting

Find repeated word and take sum of the second field to it ,for all the repeated words in awk

Hi below is the input file, i need to find repeated words and sum up the values of it which is second field from the repeated work.Im trying but getting no where close to it.Kindly give me a hint on how to go about it Input fruits,apple,20,fruits,mango,20,veg,carrot,12,veg,raddish,30... (11 Replies)
Discussion started by: 100bees
11 Replies

10. Shell Programming and Scripting

awk script to find data in three file and perform replace operation

Have three files. Any other approach with regards to file concatenation or splitting, etc is appreciated If column55(billngtype) of file1 contains YMNC or YPBC then pick the value of column13(documentnumber). Now find this documentnumber in column1(Billdoc) of file2 and grep the corresponding... (4 Replies)
Discussion started by: as7951
4 Replies
IONRC(5)						      ICI configuration files							  IONRC(5)

NAME
ionrc - ION node management commands file DESCRIPTION
ION node management commands are passed to ionadmin either in a file of text lines or interactively at ionadmin's command prompt (:). Commands are interpreted line-by line, with exactly one command per line. The formats and effects of the ION node management commands are described below. TIME REPRESENTATION
For many ION node management commands, time values must be passed as arguments. Every time value may be represented in either of two formats. Absolute time is expressed as: yyyy/mm/dd-hh:mm:ss Relative time (a number of seconds following the current reference time, which defaults to the current time at the moment ionadmin began execution but which can be overridden by the at command described below) is expressed as: +ss COMMANDS
? The help command. This will display a listing of the commands and their formats. It is the same as the h command. # Comment line. Lines beginning with # are not interpreted. e { 1 | 0 } Echo control. Setting echo to 1 causes all output printed by ionadmin to be logged as well as sent to stdout. Setting echo to 0 disables this behavior. v Version number. Prints out the version of ION currently installed. HINT: combine with e 1 command to log the version number at startup. 1 node_number { ion_config_filename | '' } The initialize command. Until this command is executed, the local ION node does not exist and most ionadmin commands will fail. The command configures the local node to be identified by node_number, a CBHE node number which uniquely identifies the node in the delay-tolerant network. It also configures ION's data store (SDR) and shared working-memory region using either the settings found in the ion_config_filename file or, if '' is supplied as the ion_config_filename, a set of default settings. Please see ionconfig(5) for details. For example: 1 19 '' would initialize ION on the local computer, assigning the local ION node the node number 19 and using default values to configure the data store and shared working-memory region. @ time The at command. This is used to set the reference time that will be used for interpreting relative time values from now until the next revision of reference time. Note that the new reference time can be a relative time, i.e., an offset beyond the current reference time. a contact start_time stop_time source_node dest_node xmit_data_rate The add contact command. This command schedules a period of data transmission from source_node to dest_node. The period of transmission will begin at start_time and end at stop_time, and the rate of data transmission will be xmit_data_rate bytes/second. d contact start_time source_node dest_node The delete contact command. This command deletes the scheduled period of data transmission from source_node to dest_node starting at start_time. To delete all contacts between some pair of nodes, use '*' as start_time. i contact start_time source_node dest_node This command will print information (the stop time and data rate) about the scheduled period of transmission from source_node to dest_node that starts at start_time. l contact This command lists all scheduled periods of data transmission. a range start_time stop_time one_node the_other_node distance The add range command. This command predicts a period of time during which the distance from one_node to the_other_node will be constant to within one light second. The period will begin at start_time and end at stop_time, and the distance between the nodes during that time will be distance light seconds. d range start_time one_node the_other_node The delete range command. This command deletes the predicted period of constant distance between one_node and the_other_node starting at start_time. To delete all ranges between some pair of nodes, use '*' as start_time. i range start_time one_node the_other_node This command will print information (the stop time and range) about the predicted period of constant distance between one_node and the_other_node that starts at start_time. l range This command lists all predicted periods of constant distance. m utcdelta local_time_sec_after_UTC This management command sets ION's understanding of the current difference between correct UTC time and the time values reported by the clock for the local ION node's computer. This delta is automatically applied to locally obtained time values whenever ION needs to know the current time. For machines that use UTC natively and are synchronized by NTP, the value of this delta should be 0, the default. m clockerr known_maximum_clock_error This management command sets ION's understanding of the accuracy of the scheduled start and stop times of planned contacts, in seconds. The default value is 1. When revising local data transmission and reception rates, ionadmin will adjust contact start and stop times by this interval to be sure not to send bundles that arrive before the neighbor expects data arrival or to discard bundles that arrive slightly before they were expected. m production planned_data_production_rate This management command sets ION's expectation of the mean rate of continuous data origination by local BP applications throughout the period of time over which congestion forecasts are computed. For nodes that function only as routers this variable will normally be zero, which is the default. m consumption planned_data_consumption_rate This management command sets ION's expectation of the mean rate of continuous data delivery to local BP applications throughout the period of time over which congestion forecasts are computed. For nodes that function only as routers this variable will normally be zero, which is the default. m occupancy data_store_occupancy_limit This management command sets the maximum number of bytes of storage space in ION's SDR non-volatile data store that can be used for the storage of bundles. The default value is 60% of the SDR data store's total heap size. m horizon { 0 | end_time_for_congestion_forecasts } This management command sets the end time for computed congestion forecasts. Setting congestion forecast horizon to zero sets the congestion forecast end time to infinite time in the future: if there is any predicted net growth in bundle storage space occupancy at all, following the end of the last scheduled contact, then eventual congestion will be predicted. The default value is zero, i.e., no end time. m alarm 'congestion_alarm_command' This management command establishes a command which will automatically be executed whenever ionadmin predicts that the node will become congested at some future time. By default, there is no alarm command. m usage This management command simply prints ION's current data store occupancy (the number of bytes of space in the SDR non-volatile data store that are occupied by bundles), the limit on occupancy, and the maximum level of occupancy predicted by the most recent ionadmin congestion forecast computation. r 'command_text' The run command. This command will execute command_text as if it had been typed at a console prompt. It is used to, for example, run another administrative program. s The start command. This command starts the rfxclock task on the local ION node. x The stop command. This command stops the rfxclock task on the local ION node. h The help command. This will display a listing of the commands and their formats. It is the same as the ? command. EXAMPLES
@ 2008/10/05-11:30:00 Sets the reference time to 1130 (UTC) on 5 October 2008. a range +1 2009/01/01-00:00:00 1 2 12 Predicts that the distance between nodes 1 and 2 (endpoint IDs ipn:1.0 and ipn:2.0) will remain constant at 12 light seconds over the interval that begins 1 second after the reference time and ends at the end of calendar year 2009. a contact +60 +7260 1 2 10000 Schedules a period of transmission at 10,000 bytes/second from node 1 to node 2, starting 60 seconds after the reference time and ending exactly two hours (7200 seconds) after it starts. SEE ALSO
ionadmin(1), rfxclock(1) perl v5.14.2 2012-05-25 IONRC(5)
All times are GMT -4. The time now is 01:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy