Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

loggly

Package Overview
Dependencies
Maintainers
0
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loggly - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0

lib/loggly/._facet.js

6

._package.json

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���#�#com.macromates.caret{
column = 19;
line = 18;
Mac OS X  2��ATTR����"�"com.macromates.caret{
column = 68;
line = 6;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���$�$com.macromates.caret{
column = 52;
line = 133;
Mac OS X  2��ATTR����$�$com.macromates.caret{
column = 90;
line = 117;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���#�#com.macromates.caret{
Mac OS X  2��ATTR����#�#com.macromates.caret{
column = 51;
line = 17;
}
/*
* loggly.js: Wrapper for node-loggly object
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -6,0 +6,0 @@ *

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���"�"com.macromates.caret{
Mac OS X  2��ATTR����"�"com.macromates.caret{
column = 2;
line = 49;
}

@@ -1,1 +0,4 @@

Mac OS X  2��ATTR�6��� � com.macromates.caretx���R������<[k0?'3/«��
Mac OS X  2��ATTR����#�#com.macromates.caret{
column = 37;
line = 16;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���"�"com.macromates.caret{
Mac OS X  2��ATTR����"�"com.macromates.caret{
column = 4;
line = 11;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���"�"com.macromates.caret{
Mac OS X  2��ATTR���"�"com.macromates.caret{
column = 4;
line = 11;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���#�#com.macromates.caret{
Mac OS X  2��ATTR���#�#com.macromates.caret{
column = 25;
line = 21;
}

@@ -5,3 +5,3 @@ /*

*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -8,0 +8,0 @@ *

@@ -0,5 +1,6 @@

/*
* core.js: Core functions for accessing Loggly
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -15,2 +16,4 @@ *

interns = require('./interns'),
Search = require('./search').Search,
Facet = require('./facet').Facet,
loggly = require('loggly');

@@ -67,2 +70,29 @@

//
// function search (query, callback)
// Returns a new search object which can be chained
// with options or called directly if @callback is passed
// initially.
//
// Sample Usage:
//
// client.search('404')
// .meta({ ip: '127.0.0.1' })
// .context({ rows: 100 })
// .run(function () { /* ... */ });
//
Loggly.prototype.search = function (query, callback) {
return new Search(query, this, callback);
};
//
// function facet (facet, query, [options], callback)
// Performs a facet search against loggly with the
// specified facet, query and options.
//
Loggly.prototype.facet = function (facet, query, callback) {
return new Facet(facet, query, this, callback);
};
//
// function getInputs ([raw], callback)

@@ -107,3 +137,2 @@ // Returns a list of all inputs for the authenicated account

//

@@ -158,51 +187,2 @@ // function addDevice (inputId, address, callback)

//
// function search (query, [options], callback)
// Performs a search against loggly with the specified query and options.
//
Loggly.prototype.search = function (/* query, [options], callback */) {
var args = Array.prototype.slice.call(arguments),
query = args.shift(), callback = args.pop(),
options = args.length > 0 ? args[0] : {};
var opts = interns.clone(options);
opts.q = query;
var searchOptions = {
uri: this.logglyUrl('search?' + qs.stringify(opts)),
auth: this.config.auth
};
interns.loggly(searchOptions, callback, function (res, body) {
callback(null, JSON.parse(body));
});
};
//
// function facet (facet, query, [options], callback)
// Performs a facet search against loggly with the
// specified facet, query and options.
//
Loggly.prototype.facet = function (/* facet, query, [options], callback */) {
var args = Array.prototype.slice.call(arguments),
facet = args.shift(), query = args.shift(), callback = args.pop(),
options = args.length > 0 ? args[0] : {};
if (['date', 'ip', 'input'].indexOf(facet) === -1) {
return callback(new Error('Cannot search with unknown facet: ' + facet));
}
var opts = interns.clone(options);
opts.q = query;
var facetOptions = {
uri: this.logglyUrl('facets', facet, '?' + qs.stringify(opts)),
auth: this.config.auth
};
interns.loggly(facetOptions, callback, function (res, body) {
callback(null, JSON.parse(body));
});
};
//
// function logglyUrl ([path, to, resource])

@@ -209,0 +189,0 @@ // Helper method that concats the string params into a url

/*
* device.js: Instance of a single Loggly device
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -6,0 +6,0 @@ *

/*
* input.js: Instance of a single Loggly input
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -6,0 +6,0 @@ *

/*
* interns.js: Internal utility functions for requesting against Loggly APIs
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -6,0 +6,0 @@ *

{
"name": "loggly",
"description": "A client implementation for Loggly cloud Logging-as-a-Service API",
"version": "0.1.4",
"version": "0.2.0",
"author": "Charlie Robbins <charlie.robbins@gmail.com>",
"contributors": [
{ "name": "Marak Squires", "email": "marak.squires@gmail.com" }
{ "name": "Marak Squires", "email": "marak.squires@gmail.com" },
{ "name": "hij1nx", "email": "hij1nx@me.com" }
],

@@ -9,0 +10,0 @@ "repository": {

@@ -88,14 +88,19 @@ # node-loggly

The search() method also takes an optional second parameter specifying options for your search:
The search() exposes a chainable interface that allows you to set additional search parameters such as: ip, input name, rows, start, end, etc.
<pre>
var util = require('util');
client.search('404', { rows: 10 }, function (err, results) {
// Inspect the result set
util.inspect(results.data);
});
client.search('404')
.meta({ ip: '127.0.0.1', inputname: test })
.context({ rows: 10 })
.run(function (err, results) {
// Inspect the result set
util.inspect(results.data);
});
</pre>
For more information about search queries in Loggly, check out the [Search Language Guide][4] on the [Loggly Wiki][5]
The context of the search (set using the `.context()` method) represents additional parameters in the Loggly API besides the search query itself. See the [Search API documentation][9] for a list of all options.
Metadata set using the `.meta()` method is data that is set in the query parameter of your Loggly search, but `:` delimited. For more information about search queries in Loggly, check out the [Search Language Guide][4] on the [Loggly Wiki][5].
### Facet Searching

@@ -106,9 +111,11 @@ Loggly also exposes searches that can return counts of events over a time range. These are called [facets][6]. The valid facets are 'ip', 'date', and 'input'. Performing a facet search is very similar to a normal search:

client.facet('ip', '404', { rows: 10 }, function (err, results) {
// Inspect the result set
util.inspect(results.data);
});
client.facet('ip', '404')
.context({ rows: 10 })
.run(function (err, results) {
// Inspect the result set
util.inspect(results.data);
});
</pre>
As with the search() method, the options parameter of the facet() method is also optional.
The chaining and options for the facet method(s) are the same as the search method above.

@@ -156,12 +163,13 @@ ### Working with Devices and Inputs

#### Author: [Charlie Robbins](http://www.charlierobbins.com)
#### Contributors: [Marak Squires](http://github.com/marak)
#### Author: [Charlie Robbins](http://www.github.com/indexzero)
#### Contributors: [Marak Squires](http://github.com/marak), [hij1nx](http://github.com/hij1nx)
[0]: http://wiki.loggly.com/apidocumentation
[1]: http://wiki.loggly.com/loggingfromcode
[3]: http://wiki.loggly.com/apidocumentation#search_uri
[3]: http://wiki.loggly.com/retrieve_events#search_uri
[4]: http://wiki.loggly.com/searchguide
[5]: http://wiki.loggly.com/
[6]: http://wiki.loggly.com/apidocumentation#facet_uris
[6]: http://wiki.loggly.com/retrieve_events#facet_uris
[7]: http://wiki.loggly.com/loggingjargon
[8]: http://vowsjs.org
[8]: http://vowsjs.org
[9]: http://wiki.loggly.com/retrieve_events#optional

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���"�"com.macromates.caret{
Mac OS X  2��ATTR����"�"com.macromates.caret{
column = 7;
line = 30;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���"�"com.macromates.caret{
Mac OS X  2��ATTR����"�"com.macromates.caret{
column = 2;
line = 66;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���#�#com.macromates.caret{
Mac OS X  2��ATTR����#�#com.macromates.caret{
column = 28;
line = 84;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���!�!com.macromates.caret{
column = 4;
line = 9;
Mac OS X  2��ATTR����#�#com.macromates.caret{
column = 27;
line = 16;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���#�#com.macromates.caret{
Mac OS X  2��ATTR����#�#com.macromates.caret{
column = 74;
line = 16;
}

@@ -1,1 +0,4 @@

Mac OS X  2��ATTR�6���!�!com.macromates.caretx���R������<[Ck0?'3/�rk��P
Mac OS X  2��ATTR����#�#com.macromates.caret{
column = 10;
line = 35;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�6���"�"com.macromates.caret{
Mac OS X  2��ATTR����"�"com.macromates.caret{
column = 26;
line = 4;
}
/*
* device-test.js: Tests for Loggly device requests
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -6,0 +6,0 @@ *

/*
* helpers.js: Test helpers for node-loggly
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -6,0 +6,0 @@ *

/*
* input-test.js: Tests for Loggly input requests
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -6,0 +6,0 @@ *

/*
* interns-test.js: Tests for Loggly interns utility module
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -17,3 +17,3 @@ *

vows.describe('node-loggly/loggly/interns').addBatch({
vows.describe('node-loggly/interns').addBatch({
"When using the interns module": {

@@ -20,0 +20,0 @@ "the clone() method": {

/*
* log-test.js: Tests for vanilla logging with no authentication.
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -6,0 +6,0 @@ *

/*
* input-test.js: Tests for Loggly input requests
*
* (C) 2010 Charlie Robbins
* (C) 2010 Nodejitsu Inc.
* MIT LICENSE

@@ -21,10 +21,22 @@ *

vows.describe('node-loggly/inputs').addBatch({
vows.describe('node-loggly/search').addBatch({
"When using the node-loggly client": {
"the search() method": {
topic: function () {
loggly.search('inputname:test', this.callback);
"when searching without chaining": {
topic: function () {
loggly.search('logging message', this.callback);
},
"should return a set of valid search results": function (err, results) {
helpers.assertSearch(err, results);
}
},
"should return a set of valid search results": function (err, results) {
helpers.assertSearch(err, results);
"when searching with chaining": {
topic: function () {
loggly.search('logging message')
.meta({ inputname: 'test' })
.run(this.callback);
},
"should return a set of valid search results": function (err, results) {
helpers.assertSearch(err, results);
}
}

@@ -35,3 +47,3 @@ },

topic: function () {
loggly.facet('ip', 'test', { from: 'NOW-1MONTH' }, this.callback);
loggly.facet('ip', 'test', this.callback);
},

@@ -41,2 +53,12 @@ "should return a set of valid search results": function (err, results) {

}
},
"when using chained searches": {
topic: function () {
loggly.facet('ip', 'test')
.context({ from: 'NOW-1MONTH' })
.run(this.callback);
},
"should return a set of valid search results": function (err, results) {
helpers.assertSearch(err, results);
}
}

@@ -43,0 +65,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc