Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bump to 0.1.7

* Handle empty host in URLs logged by Rails (Steve Purcell <steve@sanityinc.com>)
* Local File source (George Swinnerton)
* PostgreSQL Syslog support (Lionel Bouton)
* Cisco ASA parser (Jeff Bryner <jeff@jeffbryner.com>)
  • Loading branch information...
commit 8dd1e4835cfc36a0ad330db4cc896ab65e2a4c87 1 parent cc07289
erlends authored
View
29 History.txt
@@ -1,3 +1,32 @@
+== 0.1.7 / 2008-07-13
+
+* Handle empty host in URLs logged by Rails (Steve Purcell <steve@sanityinc.com>)
+* Local File source (George Swinnerton)
+* PostgreSQL Syslog support (Lionel Bouton)
+* Cisco ASA parser (Jeff Bryner <jeff@jeffbryner.com>)
+
+== 0.1.6 / 2008-05-31
+
+* Use net-ssh version < 1.2 when loading gem
+
+== 0.1.5 / 2008-05-19
+
+* Freeze net-ssh version at 1.1.4
+
+== 0.1.4 / 2008-04-29
+
+* Only trap signals on non Windows platforms (Chris Gahan)
+
+== 0.1.3 / 2008-03-28
+
+* Render strings as number + text to reuse OpenGL call-lists in more cases.
+ Fixes the annoying stuttering every second with more than a trivial amount
+ of text.
+
+== 0.1.2 / 2008-03-04
+
+* Handle rubygems versions > 0.x
+
== 0.1.1 / 2008-02-17
* Correctly sort Total and Average Blocks
View
40 dist/config.yaml
@@ -15,6 +15,12 @@ servers:
files: /var/www/apps/funapp/current/log/production.log
parser: rails
color: 0.2, 0.2, 1.0, 1.0
+ dev:
+ host: clockingit.com
+ source: local
+ files: /var/www/clockingit/logs/production.log
+ parser: rails
+ color: 0.2, 0.2, 1.0, 1.0
config:
dimensions: 1200x600
min_blob_size: 0.004
@@ -61,6 +67,23 @@ config:
database:
order: 9
size: 10
+ firewall:
+ order: 10
+ size: 15
+ action:
+ order: 11
+ size: 15
+ auto_clean: false
+ show: total
+ sourceinterface:
+ order: 12
+ size: 15
+ sourcehost:
+ order: 13
+ size: 15
+ sourceport:
+ order: 14
+ size: 15
right_column:
size: 25
@@ -96,6 +119,23 @@ config:
warnings:
order: 8
size: 5
+ destinationinterface:
+ order: 9
+ size: 15
+ ipprotocol:
+ order: 10
+ size: 15
+ destinationhost:
+ order: 11
+ size: 15
+ destinationport:
+ order: 12
+ size: 15
+ info:
+ order: 13
+ size: 15
+ auto_clean: false
+ show: total
resolver:
reverse_ip_lookups: true
reverse_timeout: 0.5
View
12 lib/gl_tail.rb
@@ -5,7 +5,7 @@
#
module GlTail
- VERSION = '0.1.6'
+ VERSION = '0.1.7'
end
begin
@@ -47,6 +47,15 @@ module GlTail
exit
end
+begin
+ require 'file/tail'
+rescue LoadError
+ puts "Missing gem file-tail."
+ puts "Ubuntu:"
+ puts " sudo gem install -y file-tail -r"
+ exit
+end
+
$:.unshift(File.dirname(__FILE__)) # this should be obsolete once its a gem
# load our libraries
@@ -59,6 +68,7 @@ module GlTail
# future options: JMS queue, spread.org, local tail, etc
require 'gl_tail/sources/base'
require 'gl_tail/sources/ssh'
+require 'gl_tail/sources/local'
%w( engine activity block item element parser resolver blob_store font_store).each {|f| require "gl_tail/#{f}" }
View
13 lib/gl_tail/config/yaml_parser.rb
@@ -35,11 +35,18 @@ def parse_servers
self.yaml['servers'].each do |server|
- src = GlTail::Source::SSH.new(@config)
+ name = server.shift
+ data = server.shift
- src.name = server.shift
+ if data['source'] && data['source'].downcase == 'local'
+ src = GlTail::Source::Local.new(@config)
+ else
+ src = GlTail::Source::SSH.new(@config)
+ end
+
+ src.name = name
- apply_values(src, server.shift)
+ apply_values(src, data)
@config.sources << src
end
View
7 lib/gl_tail/parsers/postgresql.rb
@@ -18,10 +18,15 @@ def parse( line )
_, database, datetime, activity, description = /^\[(.*), (.* .* .*)\] LOG: ([a-zA-Z0-9\s]*): (.*)/.match(line).to_a
+ unless _
+ _, database, datetime, activity, description = /postgres\[\d+\]: \[\d+-\d+\] \[(.*), (.* .* .*)\] LOG: ([a-zA-Z0-9\s]*): (.*)/.match(line).to_a
+ syslog = true if _
+ end
+
if database
add_activity(:block => 'database', :name => database, :size => 0.2)
else
- _, datetime, activity, description = /^(.* .* .*) LOG: ([a-zA-Z0-9\s]*): (.*)/.match(line).to_a
+ _, datetime, activity, description = /(.* .* .*) LOG: ([a-zA-Z0-9\s]*): (.*)/.match(line).to_a
end
if activity
View
20 lib/gl_tail/sources/local.rb
@@ -3,10 +3,26 @@ module GlTail
module Source
class Local < Base
- config_attribute :command, "The Command to run"
+ config_attribute :source, "The type of Source"
+ config_attribute :host
config_attribute :files, "The files to tail", :deprecated => "Should be embedded in the :command"
- # TODO: code to run comand locally and parse streams
+ def init
+ @log = File.open(files)
+ @log.extend(File::Tail)
+ @log.max_interval = 5
+ @log.return_if_eof = true
+ end
+
+ def process
+ @log.tail(1) { |line|
+ parser.parse(line)
+ }
+ end
+
+ def update
+ end
+
end
end
end
View
1  lib/gl_tail/sources/ssh.rb
@@ -4,6 +4,7 @@ module GlTail
module Source
class SSH < Base
+ config_attribute :source, "The type of Source"
config_attribute :command, "The Command to run"
config_attribute :files, "The files to tail", :deprecated => "Should be embedded in the :command"
config_attribute :host, "The Host to connect to"
Please sign in to comment.
Something went wrong with that request. Please try again.