Sponsored Content
Full Discussion: Extract IP addresses
Top Forums Shell Programming and Scripting Extract IP addresses Post 302300380 by pludi on Tuesday 24th of March 2009 03:23:56 AM
Old 03-24-2009
Code:
$ cat bla.log
aaa.bbb.ccc.ddd   2009-03-23 01:28:33     sshd[16272]: Failed keyboard-interactive/pam for invalid user jkljlkjlj from 111.222.333.444 port 52095 ssh2
aaa.bbb.ccc.ddd  2009-03-23 03:33:10     sshd[16648]: Failed password for invalid user oracle from 222.333.444.555 port 29093 ssh2
aaa.bbb.ccc.ddd   2009-03-23 05:23:53     sshd[17589]: Failed password for root from 333.444.555.666 port 59095 ssh2
$
$ perl -pe 's/.*\s(\d{4}-\d{2}-\d{2} .*?)\s.*(user|for) (.*?) from (.*?) .*/$1 $3 $4/' bla.log
2009-03-23 01:28:33 jkljlkjlj 111.222.333.444
2009-03-23 03:33:10 oracle 222.333.444.555
2009-03-23 05:23:53 root 333.444.555.666
$

 

10 More Discussions You Might Find Interesting

1. IP Networking

Finding IP Addresses

Is there anyway to tell what my NT IP is while logging into my UNIX box. I have users accessing our NT network and then telneting into our Unix Box. I would like to restrict access somehow. My who commands only returns the users name and pts device which changes. (1 Reply)
Discussion started by: golfs4us
1 Replies

2. UNIX for Dummies Questions & Answers

Hardware Addresses

can anyone tell me the procedure to view the MAC address for a system using linux (1 Reply)
Discussion started by: tcat
1 Replies

3. IP Networking

ip addresses

this might sound corny but i need help finding out about finding a persons ip address can u halp? and another question what the hell does ping mean??? thank u. (2 Replies)
Discussion started by: dragonslayer100
2 Replies

4. IP Networking

Ip Addresses

I'm not exactly sure what I can do with IPs... my friend won't tell me(don't ask me why, I figure it's cause he doesn't know either, hehe). I'm curious as to what theya re used for other than networking computers... if there IS any other purpose or use for them. That's all. --Evil_d00d (4 Replies)
Discussion started by: evil_d00d
4 Replies

5. UNIX and Linux Applications

email addresses

Greetings to all. I have installed dadamail on my web site and it works extremely well. I have two questions: 1. I have modified dada to bounce bad emails, but only the first newsletter will use the modifications. If I create another list, it doesn't use the modification. What gives? 2. Are... (0 Replies)
Discussion started by: okbrowder
0 Replies

6. UNIX for Dummies Questions & Answers

Different ip addresses

Hello! I have logged in using Putty into another machine 'tele'. The ip address which i used to login to 'tele' is 192.168.1.3. Now while at 'tele' when i run "#ifconfig -a" i get the same ip address i.e, 192.168.1.3. But when i run "#arp tele" it gives the output: tele (10.143.128.8) ... (9 Replies)
Discussion started by: suhail.sadaqat
9 Replies

7. Shell Programming and Scripting

Need help with IP and MAC addresses

Hi, i am working on a project where i have to write a script to find out MAC addresses of the systems with given IP address. Can anybody tell me which command i can use to find MAC address if you know IP address of the machine. Thanks (5 Replies)
Discussion started by: manmeet
5 Replies

8. IP Networking

Virtual IP addresses

How would i create virtual interface in linux to configure more than one IP address for a physical interface? any help wll be appreciated. https://www.unix.com/images/misc/progress.gif (1 Reply)
Discussion started by: salil2012
1 Replies

9. Shell Programming and Scripting

Extract list of IP addresses from a text file.

I have an xml file with IP addresses all over the show. I want to print only the IP addresses and cut off any text before or after the IP address. Example: Note: The IP addresses (x.x.x.x) do not consistently appear in the xml file as per the pattern below. Sometimes there are text before... (8 Replies)
Discussion started by: lewk
8 Replies

10. Shell Programming and Scripting

Extract e-mail addresses on a page

Hi I normally ask questions on coding but I think there is a code that can do this. I have regular text throughout my file and I want to extract all e-mail addresses from it (rather than going and searching each one). E-mails all have @ so I assume there is a way. Thanks Phil (6 Replies)
Discussion started by: phil_heath
6 Replies
REDUCE(3PVM)							  PVM Version 3.4						      REDUCE(3PVM)

NAME
pvm_reduce - Performs a reduction operation over members of the specified group. SYNOPSIS
C int info = pvm_reduce( void (*func)(), void *data, int count, int datatype, int msgtag, char *group, int rootginst) Fortran call pvmfreduce(func, data, count, datatype, msgtag, group, rootginst, info) PARAMETERS
func Function which defines the operation performed on the global data. Predefined are PvmMax, PvmMin, PvmSum, and PvmProduct. Users can define their own function. SYNOPSIS for func C void func(int *datatype, void *x, void *y, int *num, int *info) Fortran call func(datatype, x, y, num, info) data Pointer to the starting address of an array of local values. On return, the data array on the root will be overwritten with the result of the reduce operation over the group. For the other (non-root) members of the group the values of the data array upon return from the reduce operation are not defined; the values may be different than those originally passed to pvm_reduce. count Integer specifying the number of elements of datatype in the data array. The value of count should agree between all members of the group. datatype Integer specifying the type of the entries in the data array. (See below for defined types.) msgtag Integer message tag supplied by the user. msgtag should be >= 0. It allows the user's program to distinguish between different kinds of messages. group Character string group name of an existing group. rootginst Integer instance number of group member who gets the result. info Integer status code returned by the routine. Values less than zero indicate an error. DESCRIPTION
pvm_reduce() performs global operations such as max, min, sum, or a user provided operation on the data provided by the members of a group. All group members call pvm_reduce with the same size local data array which may contain one or more entries. The root task is identified by its instance number in the group. The inner workings of the pvm_reduce call are implementation dependent; however, when the pvm_reduce call completes, the root's data array will be equal to the specified operation applied element-wise to the data arrays of all the group members. A broadcast by the root can be used if the other members of the group need the resultant value(s). PVM supplies the following predefined functions that can be specified in func. PvmMin PvmMax PvmSum PvmProduct PvmMax and PvmMin are implemented for all the datatypes listed below. For complex values the minimum [maximum] is that complex pair with the minimum [maximum] modulus. PvmSum and PvmProduct are implemented for all the datatypes listed below with the exception of PVM_BYTE and BYTE1. C and Fortran defined datatypes are: C datatypes FORTRAN datatypes ----------------------------------- PVM_BYTE BYTE1 PVM_SHORT INTEGER2 PVM_INT INTEGER4 PVM_FLOAT REAL4 PVM_CPLX COMPLEX8 PVM_DOUBLE REAL8 PVM_DCPLX COMPLEX16 PVM_LONG A user defined function may be used in func. The argument func is a function with four arguments. It is the base function used for the reduction operation. Both x and y are arrays of type specified by datatype with num entries. The arguments datatype and info are as spec- ified above. The arguments x and num correspond to data and count above. The argument y contains received values. Caveat: pvm_reduce() does not block, a call to pvm_barrier may be necessary. For example, an error may occur if a task calls pvm_reduce and then leaves the group before the root has completed its call to pvm_reduce. Similarly, an error may occur if a task joins the group after the root has issued its call to pvm_reduce. Synchronization of the tasks (such as a call to pvm_barrier) was not included within the pvm_reduce implementation since this overhead is unnecessary in many user codes (which may already synchronize the tasks for other pur- poses). The current algorithm is very simple and robust. A future implementation may make more efficient use of the architecture to allow greater parallelism. ILLUSTRATION
The following example illustrates a call to pvm_reduce. Suppose you have three group members (instance numbers 0, 1, 2) with an array called Idata with 5 values as specified: instance the 5 values in the integer array 0 1, 2, 3, 4, 5 1 10, 20, 30, 40, 50 2 100, 200, 300, 400, 500 And, suppose that a call to reduce (such as the ones following) are issued where the root is the group member with instance value of 1: C: root = 1; info = pvm_reduce(PvmSum, &Idata, 5, PVM_INT, msgtag, "worker", root); Fortran: root = 1 call pvmfreduce(PvmSum, Idata, 5, INTEGER4, msgtag, "worker", root, info) Then, upon completion of the reduce call, the following will result: instance the 5 values in the integer array 0 .... not defined....... 1 111, 222, 333, 444, 555 2 .... not defined ...... EXAMPLES
C: info = pvm_reduce(PvmMax, &myvals, 10, PVM_FLOAT, msgtag, "worker", rootginst); Fortran: CALL PVMFREDUCE(PvmMax, MYVALS, COUNT, REAL4, & MTAG, 'worker', ROOT, INFO) ERRORS
These error conditions can be returned by pvm_reduce PvmNoInst Calling task is not in the group PvmBadParam The datatype specified is not appropriate for the specified reduction function. PvmSysErr Pvm system error SEE ALSO
pvm_bcast(3PVM), pvm_barrier(3PVM), pvm_psend(3PVM) 6 February, 1995 REDUCE(3PVM)
All times are GMT -4. The time now is 08:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy