Hi,
Using solaris 10 5.10 o/s
I am learning awk as I work here on the job.
What I need to do is isolate the trace file for the last 24 hours. After that I need to open those trace files and search for 'TNS-|ORA-' message from each one. These trace files MAY HAVE an occurance of them. I only need to recognize either one just once above before moving onto the next file otherwise it will become time consuming. The ultimate goal here is to do a total count (wc -l) for metric purposes. In other words if that line item includes the above it is to be counted.
So far this is what I got and would like to have some assistance or guidance as to how to complete this.
I generated the above list.
This is what I believe needs to happen next:
I need to loop thru this list, open each line using ‘more’ or ‘cat’ and do a "find" on 'TNS-|ORA-'. If it returns positive add it to the count.
count wc -l.
This part doesn’t work:
Any help or suggestions in this matter would be appreciated.
Thanks
al
Last edited by Corona688; 01-21-2015 at 01:39 PM..
Posting "Does not work" without explanation does not help you or anyone. If a command does not work for you, please show the exact circumstances you used it, and the exact error or malfunction you received. Do not paraphrase errors, or post the text as links, images, or attachments if you can avoid it: Paste the exact message, in code tags, like [code] text [/code] or by selecting the text and using the button.
Thank you.
The UNIX and Linux Forums
Not the most efficient solution, but your code could probably use a rewrite from scratch. The ls -l is especially pointless and likely to break down.
Without further info I can tell you that this:
cannot work. You have some logical and syntactical errors in there, e.g. a missing closing quote and awk and shell mixed up. awk does not know more or egrep, it needs a command or a script built from pattern {action} pairs. action is one or more awk commands, it cannot cope with shell commands.
...
Not the most efficient solution, but your code could probably use a rewrite from scratch. The ls -l is especially pointless and likely to break down.
Here is the final solution that works for me. I spent 3 hours learning about the syntax and making adjustments. This I am presently using at work.
After reviewing the results I made an adjustment to the search string to 'NS PRIMARY ERROR' . This returned unique timestamps when the files were detailed indicating the total number of times the request was refused.
Thanks for your suggestions.
regards
al
Last edited by Corona688; 01-22-2015 at 12:36 PM..
Reason: Fix accidental quadruple post
Hello,
I have been working on Awk/sed one liner which counts the number of occurrences of '|' in pipe separated lines of file and delete the line from files if count exceeds "17".
i.e need to get records having exact 17 pipe separated fields(no more or less)
currently i have below :
awk... (1 Reply)
how to find out line count ( wc -l ) for multiple fines in windows cmd
the command which i a using to find line count for single file is
type sec0001.txt | find /c /v ""
but how to use it for multiple files
to get output filewise as if this command is run like
type sec*.txt |... (2 Replies)
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)
I have a directory of files, each with a variable (though small) number of lines. I would like to go through each line in each file, and print the:
-file name
-line number
-number of matches to the pattern /comp/ for each line.
Two example files:
cat... (4 Replies)
What I'm trying to accomplish. I receive a Header and Detail file for daily processing. The detail file comes first which holds data, the header is a receipt of the detail file and has the detail files record count. Before processing the detail file I would like to put a wrapper around another... (4 Replies)
All,
How to get the list of files through a unix command which exists / created / updated between 8 PM to 11:59 PM from a particular location.
Regards
Oracle User (3 Replies)
I used this script to get the connection to a domain in two specific minutes. I need to extend to give result over a range of minutes.
The below gives total number of connections in the minutes 00:40 and 01:13 on 22nd March.
egrep "22/Mar/2013:00:40|22/Mar/2013:01:13"... (1 Reply)
I started venturing in learning the art of using AWK/GAWK and wanted to simply added a period from line #11 to line #28 or to the end of the file if there is data. So for example:
11 Centos.NM
12 dojo1
13 redhat.5.5.32Bit
14 redhat.6.2.64Bit... (5 Replies)
Hi,
I am new to AIX and I am developing a small tool for our product which helps debug memory leaks etc.
Q1)Is there a way in which i can get a function trace back as to the call (lets say malloc() )has been made in which file--> in which function.
I tried using the
#pragma options (... (0 Replies)
file1 contains:
this is a test
this is a test and only a test
this is another test
this is another test and only another only
i'd like my file to look like this:
this is a test.
this is a test and only a test.
this is another test.
this is another test and only another only. (6 Replies)