logstream 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +127 -11
- data/etc/ca.pem +76 -67
- data/lib/logstream/client.rb +16 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA512:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14af9ce654518058309aef8be98629bcea26dfcaf962797acac04709fcc6a56cc258fc98b2aad70f303265c3e2b9d5d042b7c5cec600ad186fba6512d4a0aade
|
4
|
+
data.tar.gz: 3bebdfa9608a4e5d2adb01cb8b20d1ad9e14540cb45c91692a6bb518fcbd7d775bded11b96b5647f04f056a86f0056d19355fc3560bba71e876332dcaab52879
|
5
5
|
SHA1:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d798c7101cb88557885503f033895115ee98474
|
7
|
+
data.tar.gz: 8fc9ea8fff537fd8c80ab73a5e335fa989619fe3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -57,43 +57,119 @@ other elements of the hash.
|
|
57
57
|
|
58
58
|
Available commands are defined in the following subsections. Inbound
|
59
59
|
commands can arrive from the upstream client (end-user client, or an
|
60
|
-
upstream logtailor). Outbound commands are sent to the upstream
|
60
|
+
upstream logtailor). Outbound commands are sent to the upstream
|
61
|
+
client.
|
62
|
+
|
63
|
+
In the examples that follow, "<-" indicates and inbound command and
|
64
|
+
"->" indicates an outbound command. Those indicators are merely
|
65
|
+
documentation for the examples; they are not part of the API.
|
66
|
+
|
67
|
+
### API example
|
68
|
+
|
69
|
+
The logstream CLI --debug option shows API messages as they
|
70
|
+
occur. Here is hypothetical debug output for the Dev environment of a
|
71
|
+
site named "mysite" up to the first actual log message arriving. By
|
72
|
+
default, the CLI enables the log types apache-request, php-error,
|
73
|
+
drupal-watchdog, and varnish-request.
|
74
|
+
|
75
|
+
```
|
76
|
+
$ logstream tail devcloud:mysite dev --debug
|
77
|
+
-> connect to wss://logstream.acquia.com/ah_websocket/logstream/v1
|
78
|
+
-> {"site":"devcloud:mysite","d":"deaefc1f42a4d18cb932c2eb9fa75115fba5ab83f1a3c564767ef1ce8dabf2cc","t":1404764927,"env":"dev","cmd":"stream-environment"}
|
79
|
+
<- {"cmd":"connected","server":"logstream-api-61"}
|
80
|
+
<- {"cmd":"connected","server":"bal-4"}
|
81
|
+
<- {"type":"bal-request","cmd":"available","server":"bal-4","display_type":"Balancer request"}
|
82
|
+
<- {"type":"varnish-request","cmd":"available","server":"bal-4","display_type":"Varnish request"}
|
83
|
+
-> {"cmd":"enable","type":"varnish-request","server":"bal-4"}
|
84
|
+
<- {"server":"srv-6","cmd":"connected"}
|
85
|
+
<- {"display_type":"Apache request","server":"srv-6","cmd":"available","type":"apache-request"}
|
86
|
+
-> {"cmd":"enable","type":"apache-request","server":"srv-6"}
|
87
|
+
<- {"display_type":"Apache error","server":"srv-6","cmd":"available","type":"apache-error"}
|
88
|
+
<- {"display_type":"PHP error","server":"srv-6","cmd":"available","type":"php-error"}
|
89
|
+
-> {"cmd":"enable","type":"php-error","server":"srv-6"}
|
90
|
+
<- {"display_type":"Drupal watchdog","server":"srv-6","cmd":"available","type":"drupal-watchdog"}
|
91
|
+
-> {"cmd":"enable","type":"drupal-watchdog","server":"srv-6"}
|
92
|
+
<- {"display_type":"Drupal request","server":"srv-6","cmd":"available","type":"drupal-request"}
|
93
|
+
<- {"server":"bal-5","cmd":"connected"}
|
94
|
+
<- {"msg":{"type":"varnish-request","server":"bal-4","cmd":"enable"},"cmd":"success","server":"bal-4"}
|
95
|
+
<- {"server":"srv-6","cmd":"success","msg":{"server":"srv-6","cmd":"enable","type":"apache-request"}}
|
96
|
+
<- {"server":"srv-6","cmd":"success","msg":{"server":"srv-6","cmd":"enable","type":"php-error"}}
|
97
|
+
<- {"server":"srv-6","cmd":"success","msg":{"server":"srv-6","cmd":"enable","type":"drupal-watchdog"}}
|
98
|
+
<- {"server":"bal-5","display_type":"Balancer request","cmd":"available","type":"bal-request"}
|
99
|
+
<- {"server":"bal-5","display_type":"Varnish request","cmd":"available","type":"varnish-request"}
|
100
|
+
-> {"cmd":"enable","type":"varnish-request","server":"bal-5"}
|
101
|
+
<- {"server":"bal-5","cmd":"success","msg":{"server":"bal-5","type":"varnish-request","cmd":"enable"}}
|
102
|
+
<- {"text":"107.0.255.129 - - [07/Jul/2014:20:28:53 +0000] \"GET / HTTP/1.0\" 200 2454 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36\" vhost=mysitedev.devcloud.acquia-sites.com host=mysitedev.devcloud.acquia-sites.com hosting_site=mysitedev pid=6863 request_time=80001 request_id=\"v-4fe9953a-0615-11e4-9fd8-1231392c7b9c\"","server":"srv-6","cmd":"line","http_status":200,"log_type":"apache-request","disp_time":"2014-07-07 20:28:53"}
|
103
|
+
107.0.255.129 - - [07/Jul/2014:20:28:53 +0000] "GET / HTTP/1.0" 200 2454 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36" vhost=eebjaspandev.devcloud.acquia-sites.com host=eebjaspandev.devcloud.acquia-sites.com hosting_site=eebjaspandev pid=6863 request_time=80001 request_id="v-4fe9953a-0615-11e4-9fd8-1231392c7b9c"
|
104
|
+
```
|
61
105
|
|
62
106
|
### success (outbound)
|
63
107
|
|
64
108
|
Sent by a variety of commands when a triggering command is completed
|
65
109
|
successfully (failures result in an error command). Since some commands execute
|
66
110
|
on multiple servers, a single command may generate multiple success
|
67
|
-
replies.
|
111
|
+
replies.
|
112
|
+
|
113
|
+
Parameters:
|
68
114
|
|
69
115
|
* msg: the message that succeeded
|
70
116
|
|
117
|
+
Example:
|
118
|
+
|
119
|
+
```
|
120
|
+
<- {"cmd":"success","msg":{"type":"varnish-request","server":"bal-4","cmd":"enable"},"server":"bal-4"}
|
121
|
+
```
|
122
|
+
|
71
123
|
### error (outbound)
|
72
124
|
|
73
125
|
Sent when an error occurs, either because of a bad request or any kind of
|
74
126
|
system or network failure. Since some commands execute on multiple servers, a
|
75
|
-
single command may generate multiple error replies.
|
127
|
+
single command may generate multiple error replies.
|
128
|
+
|
129
|
+
Parameters:
|
76
130
|
|
77
131
|
* code: an HTTP-like status code; i.e.: 400 means your fault, 500 means our
|
78
132
|
fault.
|
79
133
|
* description: a human-readable description of the error condition
|
80
134
|
* during: the operation that triggered the error
|
81
135
|
|
136
|
+
Example:
|
137
|
+
|
138
|
+
```
|
139
|
+
<- {"cmd"=>"error", "during"=>"{\"description\":\"this is an invalid message\"}", "description"=>"message missing cmd paramter", "code"=>400, "server"=>"logstream-api-61"}
|
140
|
+
```
|
141
|
+
|
82
142
|
### connected (outbound)
|
83
143
|
|
84
|
-
Sent upon initial connection to a server.
|
144
|
+
Sent upon initial connection to a server.
|
145
|
+
|
146
|
+
Parameters:
|
85
147
|
|
86
148
|
* server: the name of the connected server
|
87
149
|
|
150
|
+
Example:
|
151
|
+
|
152
|
+
```
|
153
|
+
<- {"cmd":"connected","server":"logstream-api-61"}
|
154
|
+
```
|
155
|
+
|
88
156
|
### available (outbound)
|
89
157
|
|
90
|
-
Sent to indicate an available log source.
|
158
|
+
Sent to indicate an available log source.
|
159
|
+
|
160
|
+
Parameters:
|
91
161
|
|
92
162
|
* type: the log type (e.g. apache-access)
|
93
163
|
* display: the suggested display name for the log type (e.g. "Apache access")
|
94
164
|
* server: the originating server for this stream
|
95
165
|
|
96
|
-
|
166
|
+
Example:
|
167
|
+
|
168
|
+
```
|
169
|
+
<- {"type":"varnish-request","cmd":"available","server":"bal-4","display_type":"Varnish request"}
|
170
|
+
```
|
171
|
+
|
172
|
+
### list-available (inbound)
|
97
173
|
|
98
174
|
Requests a list of all available log sources from one specified server or all
|
99
175
|
servers. Parameters:
|
@@ -103,38 +179,73 @@ servers. Parameters:
|
|
103
179
|
|
104
180
|
One or all servers will send available messages for each available log source.
|
105
181
|
|
182
|
+
Example:
|
183
|
+
|
184
|
+
```
|
185
|
+
-> {"server":"srv-6","cmd":"list-available"}
|
186
|
+
<- {"display_type":"Apache request","server":"srv-6","cmd":"available","type":"apache-request"}
|
187
|
+
<- {"display_type":"Apache error","server":"srv-6","cmd":"available","type":"apache-error"}
|
188
|
+
```
|
189
|
+
|
106
190
|
### enable (inbound)
|
107
191
|
|
108
192
|
Starts streaming a specific source previously offered via an
|
109
|
-
"available" command.
|
193
|
+
"available" command.
|
194
|
+
|
195
|
+
Parameters:
|
110
196
|
|
111
197
|
* type: the log type to start streaming
|
112
198
|
* server: the originating server to stream from
|
113
199
|
|
114
200
|
Sends a success or error reply.
|
115
201
|
|
202
|
+
Example:
|
203
|
+
|
204
|
+
```
|
205
|
+
-> {"cmd":"enable","type":"varnish-request","server":"bal-4"}
|
206
|
+
```
|
207
|
+
|
116
208
|
### disable (inbound)
|
117
209
|
|
118
|
-
Stops streaming from an enabled source.
|
210
|
+
Stops streaming from an enabled source.
|
211
|
+
|
212
|
+
Parameters:
|
119
213
|
|
120
214
|
* type: the log type to stop streaming
|
121
215
|
* server: the originating server to stream from
|
122
216
|
|
123
217
|
Sends a success or error reply.
|
124
218
|
|
125
|
-
|
219
|
+
Example:
|
220
|
+
|
221
|
+
```
|
222
|
+
-> {"cmd":"disable","type":"varnish-request","server":"bal-4"}
|
223
|
+
```
|
224
|
+
|
225
|
+
### list-enabled (inbound) and enabled (outbound)
|
126
226
|
|
127
227
|
Requests a list of all enabled log sources from one specified server or all
|
128
|
-
servers.
|
228
|
+
servers.
|
229
|
+
|
230
|
+
Parameters:
|
129
231
|
|
130
232
|
* server: the originating server to list; if not specified, all
|
131
233
|
connected servers will reply.
|
132
234
|
|
133
|
-
One or all servers will send a
|
235
|
+
One or all servers will send a enabled reply.
|
236
|
+
|
237
|
+
Parameters:
|
134
238
|
|
135
239
|
* enabled: an array of enabled log sources
|
136
240
|
* server: the server these logs are enabled on
|
137
241
|
|
242
|
+
Example:
|
243
|
+
|
244
|
+
```
|
245
|
+
-> {"server":"srv-6","cmd":"list-enabled"}
|
246
|
+
<-> {"server":"srv-6","cmd":"enabled","enabled":["drupal-watchdog","apache-request","php-error"]}
|
247
|
+
```
|
248
|
+
|
138
249
|
### line (outbound)
|
139
250
|
|
140
251
|
Sent when a new, enabled line of log data is available. Parameters:
|
@@ -150,3 +261,8 @@ Line messages may also contain other data depending on the log type:
|
|
150
261
|
* http_status: the HTTP status code, if the log line records an HTTP request
|
151
262
|
(e.g. from Apache, nginx, Varnish, etc)
|
152
263
|
|
264
|
+
Example:
|
265
|
+
|
266
|
+
```
|
267
|
+
<- {"text":"107.0.255.129 - - [07/Jul/2014:20:28:53 +0000] \"GET / HTTP/1.0\" 200 2454 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36\" vhost=mysitedev.devcloud.acquia-sites.com host=mysitedev.devcloud.acquia-sites.com hosting_site=mysitedev pid=6863 request_time=80001 request_id=\"v-4fe9953a-0615-11e4-9fd8-1231392c7b9c\"","server":"srv-6","cmd":"line","http_status":200,"log_type":"apache-request","disp_time":"2014-07-07 20:28:53"}
|
268
|
+
```
|
data/etc/ca.pem
CHANGED
@@ -1,8 +1,47 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
2
|
+
MIIGvzCCBaegAwIBAgIQD1pdYvA5l5l2ezeWEsVwNTANBgkqhkiG9w0BAQUFADBm
|
3
|
+
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
4
|
+
d3cuZGlnaWNlcnQuY29tMSUwIwYDVQQDExxEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
|
5
|
+
ZSBDQS0zMB4XDTEyMDgyNzAwMDAwMFoXDTE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|
96
|
+
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
|
97
|
+
+OkuE6N36B9K
|
98
|
+
-----END CERTIFICATE-----
|
data/lib/logstream/client.rb
CHANGED
@@ -31,16 +31,24 @@ module Logstream
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
def debug_send(msg)
|
35
|
+
debug("-> #{msg}")
|
36
|
+
end
|
37
|
+
|
38
|
+
def debug_recv(msg)
|
39
|
+
debug("<- #{msg}")
|
40
|
+
end
|
41
|
+
|
34
42
|
def run(url, connect_message)
|
35
43
|
EM.run do
|
36
|
-
|
44
|
+
debug_send("connect to #{url}")
|
37
45
|
ws = Faye::WebSocket::Client.new(url)
|
38
46
|
ws.on :open do
|
39
|
-
|
47
|
+
debug_send(connect_message)
|
40
48
|
ws.send(connect_message)
|
41
49
|
end
|
42
50
|
ws.on :message do |body,type|
|
43
|
-
|
51
|
+
debug_recv(body.data)
|
44
52
|
msg = JSON.parse(body.data)
|
45
53
|
case msg['cmd']
|
46
54
|
when 'success'
|
@@ -84,13 +92,16 @@ module Logstream
|
|
84
92
|
end
|
85
93
|
|
86
94
|
def send_msg(ws, msg)
|
87
|
-
|
95
|
+
body = msg.to_json
|
96
|
+
debug_send(body)
|
97
|
+
ws.send(body)
|
88
98
|
end
|
89
99
|
|
90
100
|
GREEN = '32;1'
|
91
101
|
RED = '31;1'
|
92
102
|
YELLOW = '33;1'
|
93
103
|
BLUE = '34;1'
|
104
|
+
CYAN = '46;37;1'
|
94
105
|
LOG_TYPE_COLORS = {
|
95
106
|
'apache-request' => {
|
96
107
|
/^5/ => RED,
|
@@ -106,7 +117,7 @@ module Logstream
|
|
106
117
|
'php-error' => RED,
|
107
118
|
'drupal-watchdog' => BLUE,
|
108
119
|
'logtailor-error' => RED,
|
109
|
-
'logtailor-debug' =>
|
120
|
+
'logtailor-debug' => CYAN,
|
110
121
|
}
|
111
122
|
|
112
123
|
def color(type, status)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barry Jaspan
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-04 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faye-websocket
|