Skip to content

halorgium/node-loggly-graphs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

node-loggly-graph

Example of using node-loggly with node.js and Google Charts.

Installation

Node.js, node-loggly, and paperboy are required to run this demo.

Installing

You'll need the latest node.js, 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:

  curl http://npmjs.org/install.sh | sh
  [sudo] npm install loggly
  [sudo] npm install paperboy

Now grab the node-loggly-graph example project:

  curl https://github.com/loggly/node-loggly-graphs/tarball/master
  tar xvfz loggly* 
  cd loggly*

Configuring

Edit the chart.js file and put in your Loggly subdomain, username and password:

  // connect up to loggly
  var config = {
    subdomain: "geekceo",
    auth: {
      username: "kordless",
      password: "password"
    }
  };

On Loggly, create and copy a HTTP input key and replace the one I have in the code (unless you want to send logs to our account):

var lkey = 'a3e839e9-4827-49aa-9d28-e18e5ba5a818';

You can also edit the terms list in static/index.html to search facets for other terms:

  var terms = ['HTTP AND 200', 'HTTP AND 404', 'HTTP AND 302', 'HTTP AND 50*'];

Running

Start the server by doing a:

  node chart.js

Navigate to the page and check the APIs:

  http://machine.yourdomain.com/
  http://machine.yourdomain.com/api?query=404

Caveats and TODO

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.

About

Example of using node-loggly to graph using facet call.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published