lz4를 사용하여 여러 파일의 압축을 풀 수 없습니다

lz4를 사용하여 여러 파일의 압축을 풀 수 없습니다

다음과 같은 이름의 lz4 파일이 100개 이상 있습니다.

-rw-r--r-- 1 root root 210M Apr 11 10:11 compressedfile.1-0.lz4
-rw-r--r-- 1 root root 208M Apr 11 11:35 compressedfile.1-1.lz4
-rw-r--r-- 1 root root 185M Apr 11 12:49 compressedfile.2-0.lz4
-rw-r--r-- 1 root root 193M Apr 11 13:06 compressedfile.2-1.lz4
-rw-r--r-- 1 root root 201M Apr 11 14:28 compressedfile.3-0.lz4
-rw-r--r-- 1 root root 236M Apr 11 15:02 compressedfile.3-1.lz4
....

파일은 다음과 같은 거대한 csv 파일입니다.

10.27.221.233,11,TCP,SSL,66,8578,0,,(null),510-12
10.133.205.134,10,UDP,ICMP,26,3470,1,,(null),515-10
10.92.160.173,10,TCP,SSL,66,8578,0,,(null),510-15
10.132.81.71,11,TCP,SSL,0,2,0,,(null),511-10

SSL을 사용하는 IP 주소를 필터링해야 합니다. 내 방법은 다음과 같습니다.

lz4 -dc compressedfile.1-0.lz4 | awk -F, '{if ($4=="SSL") print $1}'

그것은 하나의 파일에만 적용됩니다. 다음과 같이 와일드카드를 사용하여 여러 파일을 처리하려고 했습니다.

lz4 -dc compressedfile.*.lz4 | awk -F, '{if ($4=="SSL") print $1}'

Warning : compressedfile.1-1.lz4 won't be used ! Do you want multiple input files (-m) ? 
Warning : compressedfile.2-0.lz4 won't be used ! Do you want multiple input files (-m) ?
Warning : compressedfile.2-1.lz4 won't be used ! Do you want multiple input files (-m) ?
....
10.27.221.233
10.92.160.173
10.132.81.71
10.140.81.238
10.92.5.90
....
<it ends with the IP (with SSL) on compressedfile.1-0.lz4>

-m그런 다음 lz4에 옵션을 추가해 보았습니다 .

lz4 -mdc compressedfile.*.lz4 | awk -F, '{if ($4=="SSL") print $1}'

압축파일이 있습니다.* 압축되지 않은 파일이 생성되었습니다 :(

lz4에서 와일드카드 사용에 대한 조언이 필요합니다. for가능하면 루프 사용을 피하려고 노력하고 있습니다 .

답변1

lz4파일을 연결하여 하나의 단위로 처리할 수 있으므로 다음과 같이 작동합니다.

cat compressedfile.*.lz4 | lz4 -dc | awk -F, '{if ($4=="SSL") print $1}'

관련 정보