zcat files in and not in gzip format
Asked Answered
I

2

15

I have all my Apache access log files as access.log, access.log.1 access.log.1.gz etc... What I want is to zcat all files in and not in gzip format and pipe them into an X program.

I know I can do: zcat /var/log/apache2/access.log.*.gz | someapp... but that will just work for *.gz and not the first two logs.

Any ideas will be appreciate it

Impractical answered 6/2, 2010 at 4:37 Comment(0)
M
26

use zcat -f, it will copy uncompressed files as is

M answered 6/2, 2010 at 4:45 Comment(0)
W
0

For the specific use case of HTTP log server files, consider the zmergelog command (from the mergelog package). It additionally sorts the result of the merge chronologically.

Winter answered 27/12, 2016 at 13:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.