Code Monkey home page Code Monkey logo

node-loggly-graphs's Introduction

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.

node-loggly-graphs's People

Stargazers

Ionel Roiban avatar Steffen Opel avatar Michael Schueler avatar Raja Kapur avatar Mark Soper avatar Jason Morganson avatar Kevin Kelley avatar Oddbjørn Steffensen avatar Johan Sellström avatar Tim Carey-Smith avatar

Watchers

Tim Elliott avatar Deprecated avatar Dhruv Sharma avatar James Cloos avatar Ivan von Nagy avatar Jakub Fojtl avatar Dave Mangot avatar Peter N avatar Luke Thomas avatar Joey Nelson avatar  avatar alex seubert avatar vivekdev avatar Jiri Tomek avatar Filip Elias avatar Larry Foulkrod avatar Alex Dingle avatar Vinh Nguyen avatar Chris Casey avatar  avatar  avatar Hunter Sherman avatar Jirka Kruml avatar Vladimir Kopso avatar  avatar Lukáš Klimeš avatar Dušan Želiar avatar  avatar Vojtech Kuban avatar Samuel Móro avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.