Blogs about spelling and grammar.
Sunday, April 27th, 2008Although those topics tend to be bland, I found some awesome blogs:
- The Typo Eradication Advancement League
- Apostrophe Abuse
- That’s Punny! (not quite in the same category)
Although those topics tend to be bland, I found some awesome blogs:
This regex gets some useful information out of the HAProxy logs, ultimately for feeding to Cacti.
The log entry:
Apr 3 13:19:47 localhost.localdomain haproxy13.14.3[19065]: 67.185.245.13:4571 [03/Apr/2008:13:19:47.358] front squidfarm/squid1 0/0/0/1/+1 200 +480 - - —- 254/254/206/91 0/0 “GET /static/img/handmiddle.gif HTTP/1.1″
The regex (python):
exp2 = ".* ((?:[0-9]+\\.)+[0-9]+):.*front ([a-zA-Z0-9]+)” \
“/([0-9a-zA-Z]+) ([0-9]+)/([0-9]+)/([0-9+])/([0-9]+)/\\+([0-9]+) ” \
“([0-9]+) .*(?:GET|POST) (/)(?: HTTP|([a-zA-Z]+]) HTTP|([a-zA-Z]+)” \
“\\.([a-zA-Z]+) HTTP|([a-zA-Z]+) (?:/.*\\.([a-zA-Z]+) HTTP|.* HTTP))”
The result:
('67.185.245.13', 'squidfarm', 'squid1', '0', '0', '0', '1', '1', '200', '/', None, None, None, 'static', 'gif')
This basically breaks out each piece of data from the log. Sorry about the lame HTML formatting.