![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is wrong with the rsh? | opensuse | Shell Programming and Scripting | 2 | 10-19-2008 11:51 AM |
| What's wrong with this sed command? delete & append | minifish | Shell Programming and Scripting | 5 | 04-08-2008 10:34 PM |
| Whats wrong with the mv command | dsravan | Shell Programming and Scripting | 0 | 08-10-2006 04:30 PM |
| What am I doing wrong | guptan | UNIX for Advanced & Expert Users | 2 | 07-05-2005 11:32 AM |
| where have i gone wrong? | Blip | Shell Programming and Scripting | 3 | 01-28-2004 04:43 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi All,
can anyone tell me what is wrong with this command. tail -f /opt/olr-logs/PaymentGateway.log | grep "DEBUG - Start! AkhtarPaymentGateway - generateChecksum" | awk '{print $13}' | sed 's/,//g'>> abc But I found nothing in the file abc Please do help me.or Provide me some altenative way for this command. Thanks and regards, Akhtar Bhat. |
|
||||
|
Dear zaxxon,
Basically I need a shell script to monitor different IP's in the live logs. The problem is I am new to shell scripting and dont know much about the scripting. Look at the below line, the pattern will be always like this: [2009-02-13 15:34:53,768] DEBUG - Start! PaymentGatewayFactory - getPaymentGateway (2, 100.00,Mohit Aggarwal,1942, 1,123.50.162.248, , 9821934958) I want to extract the different IP's from this line every time when this kind of line adds to the logs. Once the IP's are extracted and moved to another file, I want to compare them with previously existing IP's instantly and if the count of any particular IP will be more than predefined Value that IP should be Displayed on the Screen. Hope you got, what is the problem ? Please do help me in this matter..... Thanks and regards, Akhtar Bhat. |
|
||||
|
Thanks for your valuable time,
But the solution shown below is not working properly although the same command is working when I replace the tail -f with the less command. tail -f /opt/olr-logs/PaymentGateway.log | grep "DEBUG - Start! PaymentGatewayFactory - getPaymentGateway" | awk -F "," '{print $7}' |
|
||||
|
Hi Akhtar ,
Try this command grep "DEBUG - Start! PaymentGatewayFactory - getPaymentGateway" test.txt|cut -d"(" -f2|awk -F, '{print $6}'>>xyz.txt The above command will write the ip address to the flat file .xyz.txt. But this will only work fine if you are sure that ip address will be the 6th field of this substring (2, 100.00,Mohit Aggarwal,1942, 1,123.50.162.248, , 9821934958). |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|