Created
September 1, 2023 05:46
-
-
Save saswata-dutta/8a809179a25e55379e131e28299ea90c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat some.logs | ggrep -n -P -o '"orderId":"[0-9-]+"|x-account-id=[0-9]+|"errorCode":"\w+"' | gawk -F':' '{arr[$1]=arr[$1]","$0} END {for (i in arr) print arr[i]}' | |
,1:"orderId":"1",1:x-account-id=6398441113,1:"errorCode":"e1",1:"errorCode":"e11" | |
,3:"orderId":"2",3:x-account-id=6398441113,3:"errorCode":"e2",3:"errorCode":"e12" | |
,5:"orderId":"3",5:x-account-id=6398441113,5:"errorCode":"e3",5:"errorCode":"e13" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment