papertrail-cli 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- papertrail-cli (0.1.0)
4
+ papertrail-cli (0.1.1)
5
5
  faraday
6
6
  json
7
7
  typhoeus
data/README.md CHANGED
@@ -1,23 +1,32 @@
1
1
  # papertrail Command-line tail & search client for Papertrail log management service
2
2
 
3
- Ask [Papertrail] for recent log messages, optionally with a search query (the output
4
- can also be piped through grep). Optionally poll for new events, like tail -f.
3
+ Small standalone [binary] to retrieve, search, and tail recent app
4
+ server log and system syslog messages from [Papertrail].
5
5
 
6
- Papertrail::SearchClient class can also be used to perform one-off API searches
7
- or follow (tail) events matching a given query (interface may change).
6
+ Supports optional Boolean search queries and polling for new events
7
+ (like "tail -f"). Example:
8
+
9
+ papertrail -f "(www OR db) (nginx OR pgsql) -accepted"
10
+
11
+ Output is line-buffered so it can be fed into a pipe, like for grep.
12
+
13
+ The [SearchClient] class can be used by other apps to perform one-off
14
+ API searches or follow (tail) events matching a given query. Interface
15
+ may change.
8
16
 
9
17
 
10
18
  ## Installation
11
19
 
12
- Install the gem, which includes a binary called "papertrail":
20
+ Install the gem ([RubyGems]), which includes a binary called "papertrail":
13
21
 
14
22
  gem install papertrail-cli
15
23
 
16
24
 
17
25
  ## Configuration
18
26
 
19
- Create ~/.papertrail.yml containing your credentials, or specify the path to
20
- that file with -c. Example (from examples/papertrail.yml.example):
27
+ Create ~/.papertrail.yml containing your credentials, or specify the
28
+ path to that file with -c. Example (from
29
+ examples/papertrail.yml.example):
21
30
  username: your@account.com
22
31
  password: yourpassword
23
32
 
@@ -63,4 +72,7 @@ Enhancement or fix:
63
72
  to your enhancement.
64
73
  4. Send a pull request.
65
74
 
75
+ [binary]: https://github.com/papertrail/papertrail-cli/blob/master/bin/papertrail
66
76
  [Papertrail]: http://papertrailapp.com/
77
+ [SearchClient]: https://github.com/papertrail/papertrail-cli/blob/master/lib/papertrail/search_client.rb
78
+ [RubyGems]: https://rubygems.org/gems/papertrail-cli
data/bin/papertrail CHANGED
@@ -54,7 +54,12 @@ class PapertrailSearch
54
54
 
55
55
  def search_and_print(client)
56
56
  events = client.search(ARGV[0])
57
- Papertrail::SearchClient.format_events(events) { |e| puts e } if events
57
+ return unless events
58
+
59
+ Papertrail::SearchClient.format_events(events) do |e|
60
+ puts e
61
+ $stdout.flush
62
+ end
58
63
  end
59
64
 
60
65
  def usage
@@ -1,5 +1,5 @@
1
1
  module PapertrailCli
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
4
4
 
5
5
  require 'papertrail/search_client'
@@ -13,14 +13,14 @@ 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.1.1'
17
- s.date = '2011-02-08'
16
+ s.version = '0.1.2'
17
+ s.date = '2011-02-09'
18
18
  s.rubyforge_project = 'papertrail-cli'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
21
21
  ## as you like.
22
22
  s.summary = "Command-line client for Papertrail hosted log management service."
23
- s.description = "Command-line client for Papertrail hosted log management service. Tails and searches system & app logs."
23
+ s.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)."
24
24
 
25
25
  ## List the primary authors. If there are a bunch of authors, it's probably
26
26
  ## better to set the email to an email list or something. If you don't have
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: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Papertrail
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-08 00:00:00 -08:00
18
+ date: 2011-02-09 00:00:00 -08:00
19
19
  default_executable: papertrail
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -74,7 +74,7 @@ dependencies:
74
74
  version: "0"
75
75
  type: :runtime
76
76
  version_requirements: *id004
77
- description: Command-line client for Papertrail hosted log management service. Tails and searches system & app logs.
77
+ 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
78
  email: troy@sevenscale.com
79
79
  executables:
80
80
  - papertrail