I am trying to grep a string out of specific .gz file in an archived .tar file.
The contents of that tar
file has an archive per host, looking something like:
APPLOG/cp13ap011/logs/domeus.log.2021-07-09.gz
APPLOG/cp15ap043/logs/domeus.log.2021-07-09.gz
APPLOG/cp14ap411/logs/domeus.log.2021-07-09.gz
APPLOG/cp11ap231/logs/domeus.log.2021-07-09.gz
I located the file location
find /backup/tmp/ -type f -name 'APPLOG-P10-2021-07-09.tar' |xargs zgrep -F 'communicationId=6700409965' >> ~/tmp/2021_07_09.txt
When I realised its a .tar file, holding the record in the demos
tar -tf APPLOG-P10-2021-07-09.tar -O |find APPLOG/ -type f -name 'domeus.log.2021-07-09*' | xargs zgrep -E "Id=6700409965" >> ~/tmp/2021_07_09.txt
The file is located here APPLOG/domeus.log.2021-07-09.gz
there are multiple machines that hold the record, but all machines would have a duplicated file name domeus.log.2021-07-09* and file is massive so it needs to refine the string "Id=6700409965"
The end it is not getting me a result of those files
-rw-r--r-- 1 0 Nov 15 16:58 2021_07_09.txt
The trick , I do not want to unzip the file unless there are no other options