Sponsored Content
Top Forums Shell Programming and Scripting awk count how many IP have received that error Post 302633685 by arrals_vl on Wednesday 2nd of May 2012 10:25:07 AM
Old 05-02-2012
awk count how many IP have received that error

Hi all,

I want to write a awk script that counts unique IPs that have received one special error.
For example

Code:
25-04-2012;192.168.70.31;1254545454545417;500.0;SUCCESS
25-04-2012;192.168.70.32;355666650914;315126423993;;General_ERROR_23
30-04-2012;192.168.70.33;e;null;null;Failure
30-04-2012;192.168.70.33;e;null;null;Failure
30-04-2012;192.168.70.33;e;null;null;Failure
30-04-2012;192.168.70.33;e;null;null;Failure
30-04-2012;192.168.70.33;e;null;null;Failure
30-04-201;192.168.70.34;e;null;null;ERROR_22
30-04-2012;192.168.70.37;e;null;null;Failure.
30-04-2012;192.168.70.10;e;null;null;Failure

The result should be:

Code:
Error name              Number of unique IPs

General_ERROR_23 =     1
Failure  = 3
ERROR_22  =  1

etc...

Thank you very much!

Ervin

Last edited by joeyg; 05-02-2012 at 11:29 AM.. Reason: Wrap data, examples, and scripts inside of CodeTags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sorting received mail in unix and another error

hello! when issuing the mail command to see my received mail, i get this error: (server)starla:/home/starla>mail Warning: Too many letters, overflowing letters concatenated msgcnt 27378 vxfs: mesg 001: vx_nospace - /dev/vg00/lvol4 file system full (1 block extent) mail: no space for temp file... (0 Replies)
Discussion started by: starla0316
0 Replies

2. Solaris

"lpr.error] Warning: Received SIGPIPE" continuously appearing in logs

On a Solaris 8 print server we're continuously (every 2 minutes or so) getting these messages in the logs: printd: Warning: Received SIGPIPE; continuing I've applied this patch and restarted the printd daemon, but it doesn't help: #109320-22: SunOS 5.8: lp patch Does anyone have any idea what... (4 Replies)
Discussion started by: aussieos
4 Replies

3. AIX

nim: error signal number 2 received

Hi to all, i am trying to make mksysb backup of a NIM client machine from NIM master and while i am reading that the backup is done successfully i get an error message below and it doesnt exit the smit screen. also the status of the command appears to be running. is there anybody who knows why... (3 Replies)
Discussion started by: omonoiatis9
3 Replies

4. Shell Programming and Scripting

awk count how many unique IPs have received that error

Hi all, I want to write a awk script that counts unique IPs that have received one special error. For example 25-04-2012;192.168.70.31;1254545454545417;500.0;SUCCESS 25-04-2012;192.168.70.32;355666650914;315126423993;;General_ERROR_23 30-04-2012;192.168.70.33;e;null;null;Failure... (2 Replies)
Discussion started by: arrals_vl
2 Replies

5. Shell Programming and Scripting

awk - count character count of fields

Hello All, I got a requirement when I was working with a file. Say the file has unloads of data from a table in the form 1|121|asda|434|thesi|2012|05|24| 1|343|unit|09|best|2012|11|5| I was put into a scenario where I need the field count in all the lines in that file. It was simply... (6 Replies)
Discussion started by: PikK45
6 Replies

6. HP-UX

Received error as Not enough space left on device

Hi Forum, We have observed one problem in one of our HP-UX machines which runs a software which connects the radio frequency scan devices and the scanned information is stored in the database through the same software. This software has thrown an error like "Not enough space left on the... (4 Replies)
Discussion started by: Nishant.Jvk
4 Replies

7. UNIX for Dummies Questions & Answers

How to count no. of received data of any one files?

Hi Guys, I have a file where is different task_id and every task id has many received data, now we have to count no. of received data for any task_id. (received means received words, i.e. count no. of received word of any task_id) Please help us Guys. (5 Replies)
Discussion started by: aaditya321
5 Replies

8. Shell Programming and Scripting

Error files count while coping files from source to destination locaton as well count success full

hi All, Any one answer my requirement. I have source location src_dir="/home/oracle/arun/IRMS-CM" My Target location dest_dir="/home/oracle/arun/LiveLink/IRMS-CM/$dc/$pc/$ct" my source text files check with below example.text file content $fn "\t" $dc "\t" $pc "\t" ... (3 Replies)
Discussion started by: sravanreddy
3 Replies

9. AIX

Error received when I was trying to check state of boot record

Hello, This is a test/lab LPAR. Recently installed and updated the SP/TL. everything seems to be working fine. (ran all post install checks) I checked the state of boot record, received the following error/failed message. Can you please explain what does this mean ? />ipl_varyon -i ... (1 Reply)
Discussion started by: dio34
1 Replies

10. UNIX for Beginners Questions & Answers

Error received

I have a program that i need to get done that gets the person's name and his grade then prints it in this order "name-grade-gradeletter" so i wrote this code: #!/bin/bash while :; do read -p "Enter the person's name: " name read -p "Enter the grade of the person: " grade case $grade in )... (3 Replies)
Discussion started by: UniverseCloud
3 Replies
AGGREGATE-IOS(1)                                              General Commands Manual                                             AGGREGATE-IOS(1)

NAME
aggregate-ios - optimise a concatenated set of cisco/IOS prefix filters to help make them nice and short. SYNOPSIS
aggregate-ios <source_config >optimised_config DESCRIPTION
Takes cisco IOS configuration on stdin, and optimises any prefix filters found using aggregate(1). Optimised filters are produced on std- out. OPTIONS
None. DIAGNOSTICS
Any diagnostics produced by aggregate(1) are passed through on stderr. EXAMPLES
The following configuration fragment: ip prefix-list AS65530 description Foo, Inc ip prefix-list AS65530 permit 10.1.0.0/16 ip prefix-list AS65530 permit 10.2.0.0/16 ip prefix-list AS65530 permit 10.2.1.0/24 ip prefix-list AS65530 permit 10.3.0.0/16 ip prefix-list AS65531 description Bar.Com ip prefix-list AS65531 seq 5 permit 192.168.1.0/24 ip prefix-list AS65531 seq 10 permit 192.168.2.0/24 ip prefix-list AS65531 seq 15 permit 192.168.0.0/19 is optimised as follows: ip prefix-list AS65530 permit 10.1.0.0/16 le 24 ip prefix-list AS65530 permit 10.2.0.0/15 le 24 ip prefix-list AS65531 permit 192.168.0.0/19 le 24 SEE ALSO
aggregate(1) HISTORY
Aggregate-ios was written by Joe Abley <jabley@mfnx.net>. BUGS
All those in aggregate(1) and then some :) Joe Abley 2000 November 27 AGGREGATE-IOS(1)
All times are GMT -4. The time now is 04:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy