I want to do something with our log files. to compare two log files for a certain pattern.
sample:
file1.log contains all the "successful" run of a procedure.
file2.log contains all the "current" running procedures.
sample line from file1.log
sample line from file2.log what I want to do is get all "processID" in file2.log that are not in file1.log
this will be executed at random or for reporting purposes.
edit:
by the way the processID looks like this
is this possible?
thanks!
Last edited by Scrutinizer; 08-24-2015 at 11:05 PM..
Reason: added some info; mod: CODE tags
Reformatting and adding comments to Scrutinizer's code:
My reading of your requirements was that you wanted to print processIDs that appear in file2.log that DO NOT also appear in file1.log. If that is what you want, I believe the line shown in red above should be changed to:
And, I don't see any need to count the number of appearances of each processID in the 1st file, so the line:
could be simplified to just:
to just note that the processID identified by p was found in the 1st input file (without counting the number of times it has been found).
I have two file as given below which shows the ACL permissions of each file. I need to compare the source file with target file and list down the difference as specified below in required output. Can someone help me on this ?
Source File
*************
# file: /local/test_1
# owner: own
#... (4 Replies)
Hi
I have file1 as
IJU_NSOMOW;
SOWWOD_TWUIQ;
and file2 as
how are you?;
fine there;
Now my problem is i need the output file as
IJU_NSOMOW; how are you?;
SOWWOD_TWUIQ; fine there; (2 Replies)
I have logs files which are generated each day depending on how many processes are running. Some days it could spin up 30 processes. Other days it could spin up 50. The log files all have the same pattern with the number being the different factor. e.g.
LOG_FILE_1.log
LOG_FILE_2.log etc etc
... (2 Replies)
Hi all,
I have 3 files with such data
first files
second file
third file
I have to find common entries of first column in two ways
1) between 2 files (2 Replies)
Hi all,
I have 2 big files with such kind of inputs
File I
File II
I want the output file shuld contain
Please let me knw scripting regarind this (1 Reply)
I have to compare 2 files which means 2 files with common entries in same column and separate those common entries in a diferent file as well right before those entries common so that I can separat common and Uncommon entries in rows in 2 different files. Is it possible
For eg.
one file
... (3 Replies)
Hello,
I need to find all *.xml files that matched by pattern on Linux. I need to have written the file name on the screen and then change the pattern in the file just was found.
For instance.
I can start the script with arguments for keyword and for value, i.e
script.sh keyword... (1 Reply)
I have 10 appservers and each appserver has 4 jvms . Each of these logs is archived and stored on a nfs directory . For example the files are
/logs/200907/ap1-jvm1.server.log.20090715.gz
/logs/200907/ap2-jvm2.server.log.20090714.gz
/logs/200908/ap1-jvm1.server.log.20090812.gz
I want to... (3 Replies)
Hi,
I need a shell program that will prompt the user to input a dept name to the script.
The script should then check a specific directory called ‘report' in the home directory of each member of that dept.
If the report directory does not exist, or there are no contents in the directory,... (2 Replies)
Hi,
I have a file having some thousand records with the following sort of lines:
Error: Failed to get order data
Order: PO-BBBTGZE
Error: No CLI
Error: Failed to get order data
Order: PO-SBDJUZA
Order: PO-XBBIDEN
Error: No CLI
Error: Failed to get order data
Order: PO-BBDJUTQ
Order:... (2 Replies)