An easy way to diff log files, ignoring the time stamps?

后端 未结 5 1745
终归单人心
终归单人心 2021-02-01 13:41

I need to diff two log files but ignore the time stamp part of each line (the first 12 characters to be exact). Is there a good tool, or a clever awk command, that could help m

5条回答
  •  深忆病人
    2021-02-01 14:03

    Use Kdiff3 and at Configure>Diff edit "Line-Matching Preprocessor command" to something like:

    sed "s/[ 012][0-9]:[0-5][0-9]:[0-5][0-9]//"

    This will filter out time-stamps from comparison alignment algorithm.

    Kdiff3 also lets you manually align specific lines.

提交回复
热议问题