0
我想grep
日志异常,并确定他们的罪名如何在列的基础用grep唯一重复的记录与数在solaris
以下独特的样品输入
[msisdn:123][trxId:1234] | subscriptions | java.lang.Exception: this msidn NOT found
[msisdn:432][trxId:1212] | subscriptions | java.lang.Exception: this msidn NOT found
[msisdn:232][trxId:3232] | subscriptions | java.lang.Exception: this msidn NOT found
我用以下,并示出了具有计数重复
grep -i exception my.log| cut -d'|' -f2- | uniq –c
其示出了结果如预期,但我松散包含MSISDN和trxid第一部分,然后我用以下
grep -i exception my.log | sort -u -k 2,3 -t'|'
它示出了具有采样线和在其上载MSISDN和trxid我可以排除该采样线的基唯一结果。
现在我怎么能得到我最后一个使用的命令?
编辑你的问题,以显示预期的输出考虑到样品的输入,我不知道,如果你想找到每计数msisdn或per trxid或两者或其他的组合。无论如何,用一个小的,清晰的awk脚本将是绝对微不足道的。 –