Take the input from output logs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Take the input from output logs
# 1  
Old 11-04-2013
Take the input from output logs

Hi,

If I have loads of logs like below and I am interested to print the requests(lines) which have taken more than 1000 ms. In this case how could I print the two highlighted lines ?

abc.log
Code:
reqquest id232342 , adfghfasdfsaf, TIME=30
reqquest id11111 , asdfdfghdffsaf, TIME=54
reqquest id2423423, asdfhdfsaf, TIME=1200
reqquest id2344455 , asdgfhfgsaf, TIME=45
reqquest id54657 , awerweraf, TIME=21
reqquest id333333, asdfasfws, TIME=1110
reqquest id68786 , sdfasdfasaf, TIME=33

Thanks,
Narayana.V

Last edited by Don Cragun; 11-04-2013 at 06:12 PM.. Reason: Add CODE tags.
# 2  
Old 11-04-2013
Code:
awk -F= '$NF>1000' abc.log

# 3  
Old 11-04-2013
Code:
grep "=[1-9][0-9]\{3\}" abc.log

# 4  
Old 11-04-2013
How do you know what is a request line?

Assumption is the line begins with reqquest:

Code:
awk -F= '/^reqquest/&&$NF>1000' abc.log

# 5  
Old 11-05-2013
Hello,

1 more approach, may help. Let us say we have check_time_value file which have Input.

Code:
awk -vs1=1000 -F"=" '$2 > s1 {print$0}' check_time_value

Otuput will be as follows.

Code:
reqquest id2423423, asdfhdfsaf, TIME=1200
reqquest id333333, asdfasfws, TIME=1110


Thanks,
R. Singh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Filtering output from given input

Hi All, I have a input file as below. Input file may contain more hostlists. sample Input file $ cat hostlist.lst cs18-db1-1-sjl cs22-db1-1-was na88-db1-1-chi na21-db1-2-was I want the output like below format. Pls help. Thanks ! Output format: ... (4 Replies)
Discussion started by: kamauv234
4 Replies

2. Shell Programming and Scripting

Pull out information from output logs

My scenario is as follows. 1. I have a reference file with the IP addresses and names $ cat ref.list 10.11.xxx.xxx AA 10.12.xxx.xxx BB 10.13.xxx.xxx CC 10.14.xxx.xxx DD 2. A script runs and gets me one of the IP addresses and puts it in a separate file, for e.g... (2 Replies)
Discussion started by: Nagesh_1985
2 Replies

3. Shell Programming and Scripting

Expect doesn't output the logs

(qemu) migrate -d tcp:192.168.122.1:4444 (qemu) info migrate capabilities: xbzrle: off Migration status: completed total time: 4425 milliseconds downtime: 3 milliseconds transferred ram: 130338 kbytes remaining ram: 0 kbytes total ram: 1057152 kbytes duplicate: 232613 pages normal:... (0 Replies)
Discussion started by: yanglei_fage
0 Replies

4. Shell Programming and Scripting

Take the input from output logs

Hi, If I have loads of logs like below and I am interested to print the requests(lines) which have taken more than 1000 ms. In this case how could I print the two highlighted lines ? abc.log reqquest id232342 , adfghfasdfsaf, TIME=30 reqquest id11111 , asdfdfghdffsaf, TIME=54 reqquest... (0 Replies)
Discussion started by: nariwithu
0 Replies

5. Shell Programming and Scripting

INPUT/OUTPUT question

Hi All, Is it wrong to do something like this: ssh -T $PROXY_USER@$PROXY_SERVER < script.txt > ssh_output.log I ran and it works fine and does what I need. I wanted to pass a set of commands to the ssh session and store an output in the log file. Thanks (4 Replies)
Discussion started by: rdogadin
4 Replies

6. Shell Programming and Scripting

Output from Logs

Hello All, I have created a script to capture logs on every day at every 3 Min.Please find in attach.So my goal is to mail all the logs to myself for pertical date.So can anyone guide me how can i this on the basis of the attached logs. Regards Ankit (0 Replies)
Discussion started by: ajaincv
0 Replies

7. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

8. Shell Programming and Scripting

input -output file

Hi, I am having an Input file .which is having a list of names. comapring with our database , needs to write the out put in file called output.txt , format should be name--> country--->phone number could you please help me.. thanks in advance (7 Replies)
Discussion started by: hegdeshashi
7 Replies

9. Shell Programming and Scripting

Using output to input another command

Hi guys. Is it possible (I'm sure it is) to use the output of a simple 'ls' command as input of another command 'tail'. It is not really the output of the 'ls'. I have to useeach line of the output. This is the first command... ls *myFile*021308* Which it outputs many filenames. For each... (3 Replies)
Discussion started by: rodrimuino
3 Replies

10. Shell Programming and Scripting

Using Output from one command as input to another

This site has been very helpful thus far.. I thank you all in advance for sharing the knowledge. Let me get to it. I am trying to write a very small script to take away from the boredom of doing the same thing over and over. Everynow and again I have to get the hex value of a file using a... (2 Replies)
Discussion started by: BkontheShell718
2 Replies
Login or Register to Ask a Question