concatenate compressed and uncompressed logs

2010-07-15 172 words 1 min read

<span style="font-size: x-large;"><a href="http://feedproxy.google.com/~r/Command-line-fu/~3/iwFUyltYgjM/concatenate-compressed-and-uncompressed-logs">concatenate compressed and uncompressed logs

$ find /var/log/apache2 -name 'access.loggz' -exec <a class="zem_slink freebase/guid/9202a8c04000641f800000000001abd9" title="Gzip" rel="homepage" href="http://www.gzip.org/">zcat {} ; -or -name 'access.log' -exec cat {} ; This command allows you to stream your log files, including gziped files, into one stream which can be piped to <a class="zem_slink freebase/guid/9202a8c04000641f800000000000584b" title="AWK" rel="homepage" href="http://cm.bell-labs.com/cm/cs/awkbook/index.html">awk or some other command for analysis.

Note: if your version of &#8217;find&#8217; supports it, use:

find /var/log/apache2 -name 'access.loggz' -exec zcat {} + -or -name 'access.log' -exec cat {} +

  • <a href="http://www.commandlinefu.com/commands/view/5882/concatenate-compressed-and-uncompressed-logs">View this command to comment, vote or add to favourites
  • <a href="http://feeds2.feedburner.com/commands/by/recursiverse">View all commands by <a href="http://feeds2.feedburner.com/commands/by/recursiverse">recursiverse

<a href="http://www.commandlinefu.com">

by David Winterbottom (<a href="http://codeinthehole.com">codeinthehole.com)

<a href="http://feedads.g.doubleclick.net/~a/mnZcA00-ZXLWCLqWniCVwaTXU4Y/0/da">
<a href="http://feedads.g.doubleclick.net/~a/mnZcA00-ZXLWCLqWniCVwaTXU4Y/1/da">

URL: <a href="http://feedproxy.google.com/~r/Command-line-fu/~3/iwFUyltYgjM/concatenate-compressed-and-uncompressed-logs">http://feedproxy.google.com/~r/Command-line-fu/~3/iwFUyltYgjM/concatenate-compressed-and-uncompressed-logs<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://blog.amit-agarwal.co.in/2010/04/12/visualizing-system-performance-data/">Visualizing system performance data (amit-agarwal.co.in) <li class="zemanta-article-ul-li"><a href="http://www.phpied.com/uncompressed-data-in-base64-probably-not/">Uncompressed data in base64? Probably not (phpied.com) <li class="zemanta-article-ul-li"><a href="http://www.stevesouders.com/blog/2010/07/12/velocity-forcing-gzip-compression/">Velocity: Forcing Gzip Compression (stevesouders.com) <li class="zemanta-article-ul-li"><a href="http://feedblog.org/2008/10/12/google-bigtable-compression-zippy-and-bmdiff/">Compression algorithms used by Google (feedblog.org) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_c15.gif" alt="Enhanced by Zemanta" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it