I have file-1 which has list of transaction id .
File -1
201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|10.233.18.29.677220869928387637969
201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|11.233.18.29.677220869928387637969
201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|12.233.18.29.677220869928387637969
I have a file-2 which has the logs .It can have pipes in other place .So pipe cannot be used as delimiter
File-2
logline-1|somefield fdfdsff dfwwtwtwt **201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|12.233.18.29.677220869928387637969**
logline-2|somefield fdfdsff dfwwtwtwt **201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|12.233.18.29.677220869928387637969**
logline-3|somefield fdfdsff dfwwtwtwt **201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|10.233.18.29.677220869928387637969**
logline-4|somefield fdfdsff dfwwtwtwt **201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|10.233.18.29.677220869928387637969**
logline-5|somefield fdfdsff dfwwtwtwt **201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|11.233.18.29.677220869928387637969**
How can i use awk to read all contents in file-1 ... grep on file 2 and create a file 3 which has (transaction id - occurrences in file 2)
Expected File-3
201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|10.233.18.29.677220869928387637969 2
201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|11.233.18.29.677220869928387637969 1
201503301616|9b8791b3-f860-409f-aad0-24debf834c1b|12.233.18.29.677220869928387637969 2