Your second example suggests that the log files are the same except for "details". Perhaps you want to examine the first line of each file. If they contain your "keyword", report the difference between them, otherwise do nothing. Repeat for the second line of each file, then the third line of each file, etc. Even if this simplification is true, you still have not explained what kind of differences to expect or how to format them.