Skip to content

Instantly share code, notes, and snippets.

@WilliamSalusky
Created March 25, 2015 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WilliamSalusky/d81cb2ea7624324fffc4 to your computer and use it in GitHub Desktop.
Save WilliamSalusky/d81cb2ea7624324fffc4 to your computer and use it in GitHub Desktop.
'use strict';
var util = require('util')
, wiseSource = require('./wiseSource.js')
;
var elasticsearch = require('elasticsearch');
var date = new Date();
var client = new elasticsearch.Client({
host : 'localhost:9200',
log: 'trace'
});
//////////////////////////////////////////////////////////////////////////////////
function HOD (api, section) {
HOD.super_.call(this, api, section);
}
util.inherits(HOD, wiseSource);
//////////////////////////////////////////////////////////////////////////////////
HOD.prototype.init = function() {
// this.hod_server = this.api.getConfig(this.section, "hodserver","localhost");
this.getDomain = function(domain, cb) {
console.log ("HOD2 : ", domain );
client.create({
index: 'hod',
type: 'domain',
id: domain,
body:{
domain: domain,
// first_seen: date.toISOString(),
// last_seen: date.toISOString(),
count: 1
}
});
return cb(null, undefined);
};
this.api.addSource(this.section, this);
var section = this.section;
};
//////////////////////////////////////////////////////////////////////////////////
exports.initSource = function(api) {
var source = new HOD(api, "hod");
source.init();
};
//////////////////////////////////////////////////////////////////////////////////
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment