MERGELOGS(1)
๐ MERGELOGS(1) โ the merge-and-consolidate-web-server-logs girlie ๐
okay so bestie, this is a page from the General Commands Manual and it's all about mergelogs โ literally the tool that smooshes your web server logs together. let's get into it ๐ซถ
โจ NAME โจ
mergelogs โ merge and consolidate web server logs ๐
๐ SYNOPSIS ๐
mergelogs -p penlog [-c] [-d] [-j jitter] [-t seconds] server1:logfile1
[server2:logfile2 ...]
that's the whole vibe, right there. one pen log, a bunch of server:logfile pairs, and she's off โจ
๐ธ EXAMPLES ๐ธ
here's how the girlies actually run it:
mergelogs -p pen.log 10.0.0.1:access_log.1 10.0.0.2:access_log.2
mergelogs -p pen.log 10.0.18.6:access_log-10.0.18.6
10.0.18.8:access_log-10.0.18.8
see? you pass the pen log with -p, then each server as address:logfile. that's it. iconic. ๐
๐ฆ DESCRIPTION ๐ฆ
okay so context, because it matters:
When pen is doing its load-balancing thing across your web servers, the web server log file is a whole mess โ every single access gets listed as coming from the host that's running pen. which makes analyzing that log file so much harder ๐ญ. it's giving "who even are these people".
so to fix that, pen makes its own log file! and that one actually has the tea: the real client address, the time of the access, the target server address, and the first few bytes of the requests. chef's kiss โจ
and here's where our main character comes in: mergelogs reads pen's log file AND the log files of all the load-balanced web servers, compares every single entry, and builds a combined log file that looks like the web server cluster was one single physical server the whole time. and the client addresses get replaced with the REAL client addresses ๐ slay.
now, the plot twist nobody asked for: if no matching client address can be found in the pen log, the server address is used instead. and like โ this should never happen, it's literally just a debugging tool. if you're seeing a large number of these, that's your sign that either the server system date needs to be set, or your jitter value is too small. fix ur clock bestie ๐ฐ๏ธ
real talk though: you probably don't want to use this program. penlog is a much more elegant and functional solution. she said what she said ๐
๐ OPTIONS ๐
-cโ do not cache pen log entries. the use of this option is not recommended, because it'll makemergelogssearch the entire pen log for every single line in the web server logs. it's giving "why would you do this to yourself" ๐ญ-dโ debugging! repeat it for more. more-d, more debug. stack 'em like scrunchies ๐-ppenlog โ the log file frompen. your source of truth, bestie โจ-jjitter โ jitter, in seconds. default is600. this is the maximum variation in time stamps between the pen and web server log files. a smaller value gives you a smaller pen log cache and faster processing, but at the risk of missed entries. tradeoffs, we love her ๐-tseconds โ the difference in seconds between the time on the pen server and UTC. for example, this is7200(two hours) in Finland. ๐ซ๐ฎ timezone math, we've all been thereserver:logfileโ web server address and the name of the log file. one per server, as many as you want ๐ฆ
๐ AUTHOR ๐
Copyright (C) 2001-2015 Ulric Eriksson, <ulric@siag.nu>. give her her flowers ๐
๐ SEE ALSO ๐
pen(1), webresolve(1), penlog(1), penlogd(1)
go read those next, bestie. especially penlog(1) โ remember what the page said ๐
and that's the whole page! this one lives in the LOCAL section of the manual โ yes, the footer literally just says LOCAL, and it's filed under MERGELOGS(1), which is where you'll find her if you ever need to look her up again. mwah ๐โจ
๐ฆ where this page comes from
- debian bookworm: pen 0.34.1-2+b1
- debian trixie: pen 0.34.1-3
- ubuntu jammy: pen 0.34.1-2build1
- ubuntu noble: pen 0.34.1-2build3
- ubuntu questing: pen 0.34.1-3
- ubuntu resolute: pen 0.34.1-3build1
- ubuntu stonking: pen 0.34.1-4build1 ยท GPL-2.0-or-later WITH OpenSSL exception
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms