papertrail-cli 0.1.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +27 -1
- data/bin/papertrail +1 -4
- data/lib/papertrail-cli.rb +1 -1
- data/lib/papertrail/search_client.rb +7 -3
- data/papertrail-cli.gemspec +4 -6
- metadata +13 -26
- data/Gemfile.lock +0 -32
data/README.md
CHANGED
@@ -15,11 +15,18 @@ API searches or follow (tail) events matching a given query. Interface
|
|
15
15
|
may change.
|
16
16
|
|
17
17
|
|
18
|
+
## Quickstart
|
19
|
+
|
20
|
+
$ [sudo] gem install papertrail-cli
|
21
|
+
$ echo "username: your@account.com\npassword: yourpass" > ~/.papertrail.yml
|
22
|
+
$ papertrail
|
23
|
+
|
24
|
+
|
18
25
|
## Installation
|
19
26
|
|
20
27
|
Install the gem ([RubyGems]), which includes a binary called "papertrail":
|
21
28
|
|
22
|
-
|
29
|
+
$ [sudo] gem install papertrail-cli
|
23
30
|
|
24
31
|
|
25
32
|
## Configuration
|
@@ -55,6 +62,22 @@ You may want to alias "trail" to "papertrail", like:
|
|
55
62
|
More: http://papertrailapp.com/
|
56
63
|
|
57
64
|
|
65
|
+
## Colorize
|
66
|
+
|
67
|
+
Pipe through [MultiTail] or [colortail]. For example:
|
68
|
+
$ papertrail | multitail -c -j
|
69
|
+
|
70
|
+
For complete control, pipe through anything capable of inserting ANSI
|
71
|
+
control characters. Here's an example that colorizes 3 fields separately
|
72
|
+
- the first 15 characters for the date, a word for the hostname, and a
|
73
|
+
word for the program name:
|
74
|
+
|
75
|
+
$ papertrail | perl -pe 's/^(.{15})(.)([\S]+)(.)([\S]+)/\e[1;31;43m\1\e[0m\2\e[1;31;43m\3\e[0m\4\e[1;31;43m\5\e[0m/g'
|
76
|
+
|
77
|
+
the "1;31;43" are bold (1), foreground red (31), background yellow (43),
|
78
|
+
and can be any ANSI [escape characters].
|
79
|
+
|
80
|
+
|
58
81
|
## Contribute
|
59
82
|
|
60
83
|
Bug report:
|
@@ -76,3 +99,6 @@ to your enhancement.
|
|
76
99
|
[Papertrail]: http://papertrailapp.com/
|
77
100
|
[SearchClient]: https://github.com/papertrail/papertrail-cli/blob/master/lib/papertrail/search_client.rb
|
78
101
|
[RubyGems]: https://rubygems.org/gems/papertrail-cli
|
102
|
+
[MultiTail]: http://www.vanheusden.com/multitail/index.html
|
103
|
+
[colortail]: http://www.codaset.com/elubow/colortail
|
104
|
+
[escape characters]: http://en.wikipedia.org/wiki/ANSI_escape_code#Colors
|
data/bin/papertrail
CHANGED
@@ -2,9 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'optparse'
|
4
4
|
require 'yaml'
|
5
|
-
require 'time'
|
6
|
-
|
7
|
-
require 'faraday'
|
8
5
|
|
9
6
|
require 'papertrail-cli'
|
10
7
|
|
@@ -74,7 +71,7 @@ Examples:
|
|
74
71
|
papertrail -f "(www OR db) (nginx OR pgsql) -accepted"
|
75
72
|
papertrail -f -d 10 "ns1 OR 'connection refused'"
|
76
73
|
|
77
|
-
More:
|
74
|
+
More: https://papertrailapp.com/
|
78
75
|
|
79
76
|
EOF
|
80
77
|
end
|
data/lib/papertrail-cli.rb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'time'
|
3
|
+
require 'always_verify_ssl_certificates'
|
4
|
+
|
1
5
|
module Papertrail
|
2
6
|
class SearchClient
|
3
7
|
attr_accessor :username, :password, :conn
|
@@ -6,14 +10,14 @@ module Papertrail
|
|
6
10
|
@username = username
|
7
11
|
@password = password
|
8
12
|
|
9
|
-
@conn = Faraday::Connection.new(:url => 'https://papertrailapp.com', :ssl => { :verify =>
|
13
|
+
@conn = Faraday::Connection.new(:url => 'https://papertrailapp.com', :ssl => { :verify => OpenSSL::SSL::VERIFY_PEER }) do |builder|
|
10
14
|
builder.basic_auth(@username, @password)
|
11
15
|
|
12
|
-
builder.adapter
|
16
|
+
builder.adapter Faraday.default_adapter
|
13
17
|
builder.response :yajl
|
14
18
|
end
|
15
19
|
|
16
|
-
@max_id_seen = {}
|
20
|
+
@max_id_seen = {}
|
17
21
|
end
|
18
22
|
|
19
23
|
# search for all events or a specific query, defaulting to all events since
|
data/papertrail-cli.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'papertrail-cli'
|
16
|
-
s.version = '0.
|
17
|
-
s.date = '2011-
|
16
|
+
s.version = '0.5.0'
|
17
|
+
s.date = '2011-03-24'
|
18
18
|
s.rubyforge_project = 'papertrail-cli'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
@@ -49,10 +49,9 @@ Gem::Specification.new do |s|
|
|
49
49
|
|
50
50
|
## List your runtime dependencies here. Runtime dependencies are those
|
51
51
|
## that are needed for an end user to actually USE your code.
|
52
|
-
s.add_dependency('typhoeus')
|
53
52
|
s.add_dependency('yajl-ruby')
|
54
|
-
s.add_dependency('faraday')
|
55
|
-
s.add_dependency('
|
53
|
+
s.add_dependency('faraday', [ '~> 0.5.7' ])
|
54
|
+
s.add_dependency('always_verify_ssl_certificates')
|
56
55
|
|
57
56
|
## List your development dependencies here. Development dependencies are
|
58
57
|
## those that are only needed during development
|
@@ -64,7 +63,6 @@ Gem::Specification.new do |s|
|
|
64
63
|
# = MANIFEST =
|
65
64
|
s.files = %w[
|
66
65
|
Gemfile
|
67
|
-
Gemfile.lock
|
68
66
|
README.md
|
69
67
|
Rakefile
|
70
68
|
bin/papertrail
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: papertrail-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
version: 0.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Papertrail
|
@@ -15,11 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-03-24 00:00:00 -07:00
|
19
19
|
default_executable: papertrail
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
22
|
+
name: yajl-ruby
|
23
23
|
prerelease: false
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
@@ -33,21 +33,23 @@ dependencies:
|
|
33
33
|
type: :runtime
|
34
34
|
version_requirements: *id001
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
36
|
+
name: faraday
|
37
37
|
prerelease: false
|
38
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
|
-
- -
|
41
|
+
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
hash:
|
43
|
+
hash: 5
|
44
44
|
segments:
|
45
45
|
- 0
|
46
|
-
|
46
|
+
- 5
|
47
|
+
- 7
|
48
|
+
version: 0.5.7
|
47
49
|
type: :runtime
|
48
50
|
version_requirements: *id002
|
49
51
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
52
|
+
name: always_verify_ssl_certificates
|
51
53
|
prerelease: false
|
52
54
|
requirement: &id003 !ruby/object:Gem::Requirement
|
53
55
|
none: false
|
@@ -60,20 +62,6 @@ dependencies:
|
|
60
62
|
version: "0"
|
61
63
|
type: :runtime
|
62
64
|
version_requirements: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: json
|
65
|
-
prerelease: false
|
66
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
-
none: false
|
68
|
-
requirements:
|
69
|
-
- - ">="
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
hash: 3
|
72
|
-
segments:
|
73
|
-
- 0
|
74
|
-
version: "0"
|
75
|
-
type: :runtime
|
76
|
-
version_requirements: *id004
|
77
65
|
description: Command-line client for Papertrail hosted log management service. Tails and searches app server logs and system syslog. Supports Boolean search and works with grep and pipe output (Unix).
|
78
66
|
email: troy@sevenscale.com
|
79
67
|
executables:
|
@@ -84,7 +72,6 @@ extra_rdoc_files: []
|
|
84
72
|
|
85
73
|
files:
|
86
74
|
- Gemfile
|
87
|
-
- Gemfile.lock
|
88
75
|
- README.md
|
89
76
|
- Rakefile
|
90
77
|
- bin/papertrail
|
data/Gemfile.lock
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
papertrail-cli (0.1.1)
|
5
|
-
faraday
|
6
|
-
json
|
7
|
-
typhoeus
|
8
|
-
yajl-ruby
|
9
|
-
|
10
|
-
GEM
|
11
|
-
remote: http://rubygems.org/
|
12
|
-
specs:
|
13
|
-
addressable (2.2.4)
|
14
|
-
faraday (0.5.5)
|
15
|
-
addressable (~> 2.2.4)
|
16
|
-
multipart-post (~> 1.1.0)
|
17
|
-
rack (>= 1.1.0, < 2)
|
18
|
-
json (1.5.1)
|
19
|
-
multipart-post (1.1.0)
|
20
|
-
rack (1.2.1)
|
21
|
-
typhoeus (0.2.0)
|
22
|
-
yajl-ruby (0.7.8)
|
23
|
-
|
24
|
-
PLATFORMS
|
25
|
-
ruby
|
26
|
-
|
27
|
-
DEPENDENCIES
|
28
|
-
faraday
|
29
|
-
json
|
30
|
-
papertrail-cli!
|
31
|
-
typhoeus
|
32
|
-
yajl-ruby
|