Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 67 lines (49 sloc) 1.967 kb
8a13f02 added docs
kord authored
1 # node-loggly-graph
2
20a2987 added docs
kord authored
3 Example of using [node-loggly](http://github.com/nodejitsu/node-loggly) with node.js and [Google Charts](http://code.google.com/apis/chart/).
8a13f02 added docs
kord authored
4
5 ## Installation
6 Node.js, node-loggly, and paperboy are required to run this demo.
7
8 ### Installing
bfcd32c Not Winston
Kord Campbell authored
9 You'll need the latest [node.js](http://nodejs.org), npm (node package manager), node-loggly, and paperboy (static server) to run the demo. Leaving you to install node.js, here are the commands for installing the rest:
8a13f02 added docs
kord authored
10
11 <pre>
12 curl http://npmjs.org/install.sh | sh
13 [sudo] npm install loggly
14 [sudo] npm install paperboy
15 </pre>
16
17 Now grab the node-loggly-graph example project:
18
19 <pre>
20 curl https://github.com/loggly/node-loggly-graphs/tarball/master
21 tar xvfz loggly*
22 cd loggly*
23 </pre>
24
25 ### Configuring
26 Edit the *chart.js* file and put in your Loggly subdomain, username and password:
27
28 <pre>
c49311a fixed commas
kord authored
29 // connect up to loggly
8a13f02 added docs
kord authored
30 var config = {
31 subdomain: "geekceo",
32 auth: {
33 username: "kordless",
34 password: "password"
35 }
36 };
37 </pre>
38
ed01e6c put in a bit about the http input keys
Kord Campbell authored
39 On Loggly, [create and copy a HTTP input key](http://wiki.loggly.com/send_events) and replace the one I have in the code (unless you want to send logs to our account):
40
41 <pre>
42 var lkey = 'a3e839e9-4827-49aa-9d28-e18e5ba5a818';
43 </pre>
44
8a13f02 added docs
kord authored
45 You can also edit the terms list in *static/index.html* to search facets for other terms:
46
47 <pre>
c49311a fixed commas
kord authored
48 var terms = ['HTTP AND 200', 'HTTP AND 404', 'HTTP AND 302', 'HTTP AND 50*'];
8a13f02 added docs
kord authored
49 </pre>
50
51 ### Running
52 Start the server by doing a:
53
54 <pre>
55 node chart.js
56 </pre>
57
58 Navigate to the page and check the APIs:
59
60 <pre>
61 http://machine.yourdomain.com/
62 http://machine.yourdomain.com/api?query=404
63 </pre>
64
92b2e8a Note about search limitations.
Kord Campbell authored
65 ### Caveats and TODO
66 The facet searches only look for the occurrence of a given string, such as 'safari', and then total all the instances of that over all requests. Ideally you'd want to isolate and extract a sampling of user-agents over a shorter timeframe, dedup all the IP addresses and drop all the activty by bots.
Something went wrong with that request. Please try again.