event-buffer-factory.js
function createLogRequest(logger, utils, path, environment, emitter, failureCallback) {

  'use strict';

  logger.logEnter('createLogRequest ' + path);

  var options = environment.elasticsearchOptions('POST', path);

  var respConsumer = utils.responseConsumer(logger, 'after posting events', 200, failureCallback ? failureCallback : emitter, null, 201, options, path);

  var request = environment.request(options, respConsumer);

  request.once('error', function (e) {
    emitter.emit('error', 'Error while reporting events: ' + e);
  });

  request.setHeader('Content-Type', 'text/plain');

  logger.logExit('createLogRequest');

  return request;
}
function createLogRequest(logger, utils, path, environment, emitter, failureCallback) {

  'use strict';

  logger.logEnter('createLogRequest ' + path);

  var options = environment.elasticsearchOptions('POST', path);

  var respConsumer = utils.responseConsumer(logger, 'after posting events', 200, failureCallback ? failureCallback : emitter, null, 201, options, path);

  var request = environment.request(options, respConsumer);

  request.once('error', function (e) {
    emitter.emit('error', 'Error while reporting events: ' + e);
  });

  request.setHeader('Content-Type', 'text/plain');

  logger.logExit('createLogRequest');

  return request;
}
function createLogRequest ( logger , utils , path , environment , emitter , failureCallback ) { 'use strict' ; logger . logEnter ( 'createLogRequest ' + path ) ; var options = environment . elasticsearchOptions ( 'POST' , path ) ; var respConsumer = utils . responseConsumer ( logger , 'after posting events' , 200 , failureCallback ? failureCallback : emitter , null , 201 , options , path ) ; var request = environment . request ( options , respConsumer ) ; request . once ( 'error' , function ( e ) { emitter . emit ( 'error' , 'Error while reporting events: ' + e ) ; } ) ; request . setHeader ( 'Content-Type' , 'text/plain' ) ; logger . logExit ( 'createLogRequest' ) ; return request ; }
Creates and initializes a request object for POSTing to Elasticsearch.
Creates and initializes a request object for POSTing to Elasticsearch .