Skip to content

Commit

Permalink
Proto update (#36)
Browse files Browse the repository at this point in the history
* Add application_id into collected-message proto

* Update examples
  • Loading branch information
kkuzmin authored Mar 2, 2020
1 parent 3b3f18f commit db1f490
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
6 changes: 4 additions & 2 deletions al_log.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ const PAYLOAD_BATCH_SIZE = 10000000;
* message: 'some message string',
* messageType: 'json/azure.o365',
* messageTypeId: 'AzureActiveDirectory',
* messageTsUs: undefined
* messageTsUs: undefined,
* applicationId: 'o365'
* };
* Consult 'collected_message' definition in proto/common_proto.piqi.proto
* @param callback
Expand Down Expand Up @@ -181,7 +182,8 @@ function buildHostmeta(hostId, hostmetaElems, callback) {
* message: 'some message string',
* messageType: 'json/azure.o365',
* messageTypeId: 'AzureActiveDirectory',
* messageTsUs: undefined
* messageTsUs: undefined,
* applicationId: 'o365'
* };
* Consult 'collected_message' definition in proto/common_proto.piqi.proto
* @param callback
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alertlogic/al-collector-js",
"version": "1.4.2",
"version": "1.4.3",
"license": "MIT",
"description": "Alert Logic Collector Common Library",
"repository": {
Expand Down
1 change: 1 addition & 0 deletions proto/common_proto.piqi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ message collected_message {
required string message_type = 7;
optional string message_type_id = 8;
optional fixed32 message_ts_us = 9;
optional string application_id = 10;
}

message collected_batch {
Expand Down
22 changes: 22 additions & 0 deletions proto/common_proto.piqi_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ $root.common_proto = (function() {
* @property {string} messageType collected_message messageType
* @property {string|null} [messageTypeId] collected_message messageTypeId
* @property {number|null} [messageTsUs] collected_message messageTsUs
* @property {string|null} [applicationId] collected_message applicationId
*/

/**
Expand Down Expand Up @@ -1000,6 +1001,14 @@ $root.common_proto = (function() {
*/
collected_message.prototype.messageTsUs = 0;

/**
* collected_message applicationId.
* @member {string} applicationId
* @memberof common_proto.collected_message
* @instance
*/
collected_message.prototype.applicationId = "";

/**
* Creates a new collected_message instance using the specified properties.
* @function create
Expand Down Expand Up @@ -1038,6 +1047,8 @@ $root.common_proto = (function() {
writer.uint32(/* id 8, wireType 2 =*/66).string(message.messageTypeId);
if (message.messageTsUs != null && message.hasOwnProperty("messageTsUs"))
writer.uint32(/* id 9, wireType 5 =*/77).fixed32(message.messageTsUs);
if (message.applicationId != null && message.hasOwnProperty("applicationId"))
writer.uint32(/* id 10, wireType 2 =*/82).string(message.applicationId);
return writer;
};

Expand Down Expand Up @@ -1099,6 +1110,9 @@ $root.common_proto = (function() {
case 9:
message.messageTsUs = reader.fixed32();
break;
case 10:
message.applicationId = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
Expand Down Expand Up @@ -1165,6 +1179,9 @@ $root.common_proto = (function() {
if (message.messageTsUs != null && message.hasOwnProperty("messageTsUs"))
if (!$util.isInteger(message.messageTsUs))
return "messageTsUs: integer expected";
if (message.applicationId != null && message.hasOwnProperty("applicationId"))
if (!$util.isString(message.applicationId))
return "applicationId: string expected";
return null;
};

Expand Down Expand Up @@ -1212,6 +1229,8 @@ $root.common_proto = (function() {
message.messageTypeId = String(object.messageTypeId);
if (object.messageTsUs != null)
message.messageTsUs = object.messageTsUs >>> 0;
if (object.applicationId != null)
message.applicationId = String(object.applicationId);
return message;
};

Expand Down Expand Up @@ -1246,6 +1265,7 @@ $root.common_proto = (function() {
object.messageType = "";
object.messageTypeId = "";
object.messageTsUs = 0;
object.applicationId = "";
}
if (message.hostname != null && message.hasOwnProperty("hostname"))
object.hostname = message.hostname;
Expand All @@ -1271,6 +1291,8 @@ $root.common_proto = (function() {
object.messageTypeId = message.messageTypeId;
if (message.messageTsUs != null && message.hasOwnProperty("messageTsUs"))
object.messageTsUs = message.messageTsUs;
if (message.applicationId != null && message.hasOwnProperty("applicationId"))
object.applicationId = message.applicationId;
return object;
};

Expand Down

0 comments on commit db1f490

Please sign in to comment.