-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
338 lines (332 loc) · 16.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html>
<head>
<title>Juttle</title>
<meta name="description" content="One query language to rule them all.">
<meta name="google-site-verification" content="OpkziSlKrXgXb4tGRoyEoeZUxY83RQBFoYAKWyHuKbg" />
<link rel="stylesheet" href="assets/bootstrap.min.css">
<script type="text/javascript" src="assets/jquery.min.js"></script>
<script type="text/javascript" src="assets/typed.min.js"></script>
<script type="text/javascript" src="assets/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="dist/main.css">
</head>
<body>
<header>
<div class="container navbar-container">
<div class="navbar-header">
<button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#juttle-navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="juttle-navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/juttle/juttle">GitHub</a></li>
<li><a href="http://juttle.github.io/juttle/">Docs</a></li>
<li><a href="https://github.com/juttle/juttle/wiki">Wiki</a></li>
<li><a href="https://gitter.im/juttle/juttle">Chat</a></li>
</ul>
</div>
</div>
</header>
<div class="hero">
<div class="title">Juttle</div>
<div class="description">One query language* to rule them all</div>
<div class="sub-description">*okay, more than just a query language, but KISS</div>
<div class="buttons">
<a class="btn btn-default btn-lg" href="https://github.com/juttle/juttle"><img src="images/icon-github.svg" /> GitHub</a>
<a class="btn btn-default btn-lg" href="http://juttle.github.io/juttle/">Docs</a>
</div>
</div>
<div class="sections">
<div class="section container">
<div class="juttle-example">
<h3>
Write once, run against anything:
</h3>
<div class="code highlight">
<span class="kr">read</span>
<div class="adapter-container" style="width: 100px;">
<span id="log-example-adapter" class="adapter"</span>
</div>
-last <span class="s s-Moment">:day:</span> status_code=<span class="mi">500</span><br>
<span class="o">|</span> <span class="kr">reduce</span> -every
<span class="s s-Moment">:1m:</span> count()<br>
<span class="o">|</span> <span class="kr">view</span> table
</div>
<p class="description">
Find all the log lines with status_code 500 in the last
day and return the per-hour counts - either from
splunk, a file, or elastic.
</p>
</div>
<div class="juttle-example">
<h3>
Mixed historical / live moving averages are just one line away:
</h3>
<div class="code highlight">
<span class="kr">read</span>
<div class="adapter-container" style="width: 110px;">
<span id="moving-average-example-adapter" class="adapter"></span>
</div>
-from <span class="s s-Moment">:1 hour ago:</span> -to <span class="s s-Moment">:end:</span>
name = <span class="s2">'cpu'</span>
<br />
<span class="o">|</span> <span class="kr">reduce</span> -over
<span class="s s-Moment">:5m:</span> -every
<span class="s s-Moment">:30s:</span> avg(<span class="s2">'value'</span>) by host<br>
<span class="o">|</span> <span class="kr">view</span> timechart
</div>
<p class="description">
Plot a 5 minute moving average CPU usage, grouped by host, starting one hour ago and updating every 30 seconds.
</p>
</div>
<div class="juttle-example">
<h3>
Join data from disparate sources:
</h3>
<div class="code highlight">
<span class="o">(</span><br>
<span class="kr">read</span> elastic -last <span class="s s-Moment">:1 day:</span> source=<span class="s">"access_log"</span><br />
| <span class="kr">reduce</span> count() by user_id;<br />
<br />
<span class="kr">read</span> postgres -table <span class="s">"users"</span>;<br />
<span class="o">)</span><br />
<span class="o">|</span> <span class="kr">join</span> user_id<br />
<span class="o">|</span> <span class="kr">reduce</span> count=sum(count) by company<br />
<span class="o">|</span> <span class="kr">sort</span> count -desc<br />
<span class="o">|</span> <span class="kr">head</span> 10<br />
<span class="o">|</span> <span class="kr">view</span> barchart
</div>
<p class="description">
Count the access logs for the past day by user_id, join with the static users database to map each user's id to the corresponding company name, then add up the counts by company and display the top 10 in a barchart.
</p>
</div>
</div>
<div class="section center-block">
<div class="header">
Anatomy of a Juttle
</div>
<div class="main">
<img id="juttle-anatomy" class="center-block" style="width: 90%;" src="images/juttle-anatomy.svg"/>
</div>
</div>
<div class="section center-block darker">
<div class="header">
The supporting cast
</div>
<div class="main">
<div class="components container">
<div class="row">
<div class="col-md-5">
<div class="description">
<p class="name">
<a href="https://github.com/juttle/juttle-engine">Juttle Engine</a>
</p>
<p>
Juttle Engine brings together <a href="https://github.com/juttle/juttle">Juttle</a>, <a href="https://github.com/juttle/juttle-service">Juttle Service</a>, <a href="http://juttle.github.io/juttle/adapters">adapters</a>, <a href="https://github.com/juttle/juttle-viewer">Juttle Viewer</a>, <a href="https://github.com/juttle/juttle-viz">Juttle Viz</a>, and <a href="https://github.com/juttle/juttle-client-library">Juttle Client Library</a>.
</p>
<p>
Run juttles stored on your filesystem and see the results right in your browser.
</p>
</div>
</div>
<div class="col-md-7">
<img class="center-block" src="images/stock_prices_example.png"/>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-5">
<div class="description">
<p class="name">
<a href="http://juttle.github.io/juttle/adapters">Adapters</a>
</p>
<p>
Adapters are juttle's gateway to the world of data stores and services. There are already a bunch to get you started.
</p>
<p>
Don't see an adapter you need? Write one yourself or file an issue to request a new one.
</p>
</div>
</div>
<div class="col-md-7">
<div class="adapters-list">
<a href="https://github.com/juttle/juttle-elastic-adapter">Elastic</a>
<a href="https://github.com/juttle/juttle-influx-adapter">InfluxDB</a>
<a href="https://github.com/juttle/juttle-mysql-adapter">MySQL</a>
<a href="https://github.com/juttle/juttle-sqlite-adapter">SQLite</a>
<a href="https://github.com/juttle/juttle-postgres-adapter">Postgres</a>
<a href="https://github.com/juttle/juttle-aws-adapter">AWS</a>
<a href="https://github.com/juttle/juttle-s3-adapter">S3</a>
<a href="https://github.com/juttle/juttle-cloudwatch-adapter">Cloudwatch</a>
<a href="http://juttle.github.io/juttle/adapters/http">HTTP</a>
<a href="https://github.com/juttle/juttle-redis-adapter">Redis</a>
<a href="https://github.com/juttle/juttle-graphite-adapter">Graphite</a>
<a href="https://github.com/juttle/juttle-opentsdb-adapter">OpenTSDB</a>
<a href="https://github.com/juttle/juttle-splunk-adapter">Splunk</a>
<a href="http://juttle.github.io/juttle/adapters/file">File</a>
<a href="http://juttle.github.io/juttle/adapters/stdio">STDIO</a>
</div>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-5">
<div class="description">
<p class="name">
<a href="https://github.com/juttle/juttle-service">Juttle Service</a>
</p>
<p>
Juttle Service exposes a REST API to run juttles. Hit it directly, or use <a href="https://github.com/juttle/juttle-client-library">Juttle Client Library</a> to make streaming juttles and charts a breeze.
</p>
</div>
</div>
<div class="col-md-7">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#juttle-service-request" aria-controls="juttle-service-request" role="tab" data-toggle="tab">Request</a></li>
<li role="presentation"><a href="#juttle-service-response" aria-controls="juttle-service-response" role="tab" data-toggle="tab">Response</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="juttle-service-request">
<pre>
POST /api/v0/jobs HTTP/1.1
Host: localhost:2000
Content-Type: application/json
{
"bundle": {
"program": "emit -limit 2 | put v = count() | view table"
},
"wait": true
}
</pre>
</div>
<div role="tabpanel" class="tab-pane" id="juttle-service-response">
<pre>
{
"output": {
"view0": {
"options": {
"_jut_time_bounds": []
},
"type": "table",
"data": [
{
"type": "points",
"points":[
{
"time": "$date$2016-03-09T18:31:10.047Z",
"v": 1
},
{
"time": "$date$2016-03-09T18:31:11.047Z",
"v": 2
}
]
}
]
}
},
"errors": [],
"warnings":[]
}
</pre>
</div>
</div>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-5">
<div class="description">
<p class="name">
<a href="https://github.com/juttle/embedded-juttle">Embedded Juttle</a>
</p>
<p>
Embedded juttle lets you run juttle queries against in-memory data instead of data stores, right in the browser.
</p>
</div>
</div>
<div class="col-md-7">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#embedded-juttle-code" aria-controls="embedded-juttle-code" role="tab" data-toggle="tab">Code</a></li>
<li role="presentation"><a href="#embedded-juttle-result" aria-controls="embedded-juttle-result" role="tab" data-toggle="tab">Result</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="embedded-juttle-code">
<pre>
const points = [
{
time: new Date(1000),
v: 1
},
{
time: new Date(2000),
v: 2
}
];
let juttle = new EmbeddedJuttle('put v2 = v | view table');
juttle.run({
wait: true,
points: points
}).then((result) => {
console.log(JSON.stringify(result, null, 2));
})
.catch((err) => {
console.log("got an error trying to do runBatch: " + err);
});
</pre>
</div>
<div role="tabpanel" class="tab-pane" id="embedded-juttle-result">
<pre>
{
"output": {
"view0": {
"type": "table",
"options": {},
"data": [
{
"type": "point",
"point": {
"time": "1970-01-01T00:00:01.000Z",
"v": 1,
"v2": 1
}
},
{
"type": "point",
"point": {
"time": "1970-01-01T00:00:02.000Z",
"v": 2,
"v2": 2
}
}
]
}
},
"warnings": [],
"errors": []
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="main.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-45515012-5', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>