eklitzke / lua-bz2

a binding to libbzip2 for lua

This URL has Read+Write access

lua-bz2 / example.lua
100644 12 lines (10 sloc) 0.315 kb
1
2
3
4
5
6
7
8
9
10
11
12
-- This script prints all of the lines in the access line that start with 10.
-- (i.e. the IP address in the access log was a 10.x.x.x IP address)
require("bz2")
 
b = bz2.open("access_log.bz2")
line = b:getline()
while line ~= nil do
if line:find("^10\.") then io.write(line) end
line = b:getline()
end
b:close()