Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit a243797

Browse files
author
Chris Wiechmann
committed
Created test-indicies now using Mapping-Config as created by Logstash
1 parent 6b5545d commit a243797

10 files changed

+38
-48
lines changed

elk-traffic-monitor-api/flows/trafficMonitorApi-circuitpath.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@
7979
"name": "status",
8080
"type": "number",
8181
"value": "200",
82-
"metaName": "status",
82+
"metaName": "Status",
8383
"metaDescription": "The HTTP status code"
8484
},
8585
{
8686
"name": "body",
8787
"type": "jsonpath",
8888
"value": "$.result",
89-
"metaName": "body",
89+
"metaName": "Body",
9090
"metaDescription": "The response payload"
9191
}
9292
],
@@ -116,7 +116,7 @@
116116
"type": "string",
117117
"value": "\"let result = [];\\n //console.log(data);\\n \\n if(typeof data.hits[0] != \\\"undefined\\\"){\\n \\tresult = data.hits[0]._source.circuitPath;\\n }\\n \\n return result;\"",
118118
"metaName": "code",
119-
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
119+
"metaDescription": "A JavaScript function body. Supports `await` and returning promises."
120120
}
121121
],
122122
"outputs": {
@@ -154,7 +154,7 @@
154154
"type": "string",
155155
"value": "\"let index = 'apigw-traffic-details*';\\n if(data.config.testElasticIndex) {\\n index = data.config.testElasticIndex;\\n }\\n return index;\"",
156156
"metaName": "code",
157-
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
157+
"metaDescription": "A JavaScript function body. Supports `await` and returning promises."
158158
}
159159
],
160160
"outputs": {
@@ -192,7 +192,7 @@
192192
"type": "string",
193193
"value": "\"let elasticQuery = ({\\n \\\"bool\\\": {\\n \\\"must\\\": {\\n \\\"term\\\": {\\n \\\"correlationId\\\": data.params.correlationID\\n }\\n },\\n \\\"filter\\\": {\\n \\t\\\"term\\\": {\\n \\t\\t\\\"processInfo.serviceId\\\": data.params.serviceID\\n \\t}\\n \\t}\\n }\\n});\\n\\n return elasticQuery;\"",
194194
"metaName": "code",
195-
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
195+
"metaDescription": "A JavaScript function body. Supports `await` and returning promises."
196196
}
197197
],
198198
"outputs": {
@@ -222,14 +222,14 @@
222222
"name": "status",
223223
"type": "number",
224224
"value": "500",
225-
"metaName": "status",
225+
"metaName": "Status",
226226
"metaDescription": "The HTTP status code"
227227
},
228228
{
229229
"name": "body",
230230
"type": "object",
231231
"value": "{\n \"errors\": [\n {\n \"code\": \"n.a\",\n \"message\": \"error occurred\" \n }\n ]\n}",
232-
"metaName": "body",
232+
"metaName": "Body",
233233
"metaDescription": "The response payload"
234234
}
235235
],

elk-traffic-monitor-api/flows/trafficMonitorApi-getinfo.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"type": "string",
5050
"value": "\"let index = 'apigw-traffic-details*';\\n //let index = 'getinfo_test_1688';\\n \\n if(data.config.testElasticIndex) {\\n index = data.config.testElasticIndex;\\n }\\n \\n return index;\"",
5151
"metaName": "code",
52-
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
52+
"metaDescription": "A JavaScript function body. Supports `await` and returning promises."
5353
}
5454
],
5555
"outputs": {
@@ -87,7 +87,7 @@
8787
"type": "string",
8888
"value": "\"//only json is supported. \\n //If param format is skipped automatically json is returned\\n\\n if(data.params.format != undefined && data.params.format != 'json') {\\n throw {\\n name: \\\"unknown format exception\\\",\\n message: \\\"unknown format\\\"\\n };\\n }\\n\\n return data.params;\"",
8989
"metaName": "code",
90-
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
90+
"metaDescription": "A JavaScript function body. Supports `await` and returning promises."
9191
}
9292
],
9393
"outputs": {
@@ -125,7 +125,7 @@
125125
"type": "string",
126126
"value": "\"let elasticQuery = ({\\n \\\"bool\\\": {\\n \\\"must\\\": [\\n {\\\"term\\\": {\\\"correlationId\\\": data.params.correlationID}},\\n {\\\"term\\\": {\\\"processInfo.serviceId\\\": data.params.serviceID}}\\n ]\\n }\\n });\\n \\n \\n return elasticQuery;\"",
127127
"metaName": "code",
128-
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
128+
"metaDescription": "A JavaScript function body. Supports `await` and returning promises."
129129
}
130130
],
131131
"outputs": {
@@ -194,14 +194,14 @@
194194
"name": "status",
195195
"type": "number",
196196
"value": "200",
197-
"metaName": "status",
197+
"metaName": "Status",
198198
"metaDescription": "The HTTP status code"
199199
},
200200
{
201201
"name": "body",
202202
"type": "jsonpath",
203203
"value": "$.result",
204-
"metaName": "body",
204+
"metaName": "Body",
205205
"metaDescription": "The response payload"
206206
}
207207
],
@@ -231,7 +231,7 @@
231231
"type": "string",
232232
"value": "\"//init variables\\n \\n let transactionInfo = {};\\n let sourceLegs = [];\\n let resultLegs = [];\\n let legParam = data.params.legID;\\n let detailsParam = data.params.details;\\n let sheadersParam = data.params.sheaders;\\n let rheadersParam = data.params.rheaders;\\n let elasticData = data.elasticsearch.result.body.hits;\\n \\n \\n transactionInfo = elasticData.hits[0]._source;\\n sourceLegs = transactionInfo.transactionElements;\\n \\n // Loop over legs\\n for (var item in sourceLegs) {\\n let sourceLeg = sourceLegs[item];\\n let resultLeg = {};\\n let details = {};\\n\\n\\tlet rheaders = [];\\n let sheaders = [];\\n \\n if (legParam == '*' || legParam == sourceLeg.leg)\\n {\\n \\n if (detailsParam == '1'){\\n details.uri = sourceLeg.protocolInfo.http.uri;\\n details.status = sourceLeg.protocolInfo.http.status;\\n details.statustext = sourceLeg.protocolInfo.http.statusText;\\n details.method = sourceLeg.protocolInfo.http.method;\\n details.vhost = (typeof sourceLeg.protocolInfo.http.vhost === 'undefined') ? null : sourceLeg.protocolInfo.http.vhost; // needs to be checked - not avail in test data\\n details.wafStatus = sourceLeg.protocolInfo.http.wafStatus;\\n details.bytesSent = sourceLeg.protocolInfo.http.bytesSent;\\n details.bytesReceived = sourceLeg.protocolInfo.http.bytesReceived;\\n details.remoteName = sourceLeg.protocolInfo.http.remoteName;\\n details.remoteAddr = sourceLeg.protocolInfo.http.remoteAddr;\\n details.localAddr = sourceLeg.protocolInfo.http.localAddr;\\n details.remotePort = sourceLeg.protocolInfo.http.remotePort;\\n details.localPort = sourceLeg.protocolInfo.http.localPort; \\n details.sslsubject = (typeof sourceLeg.protocolInfo.http.sslSubject === 'undefined') ? null : sourceLeg.protocolInfo.http.sslSubject; //need to be checked - not avail in test data \\n details.leg = sourceLeg.leg;\\n details.timestamp = Date.parse(transactionInfo['@timestamp']); //Needs to be formatted\\n details.duration = sourceLeg.duration;\\n details.correlationId = transactionInfo.correlationId;\\n details.serviceName = sourceLeg.serviceName;\\n details.subject = sourceLeg.protocolInfo.http.authSubjectId;\\n details.operation = sourceLeg.operation;\\n details.type = 'http'; //ToDo - currently hardcoded. Get it from path param in future\\n details.finalStatus = (typeof sourceLeg.finalStatus === 'undefined') ? null : sourceLeg.finalStatus; //need to be checked - not always avail in test data \\n resultLeg.details = details;\\n } else if (detailsParam == '0'){ \\n resultLeg.details = null;\\n } else{\\n // No details element at all\\n }\\n\\n \\n // Formatting the rHeaders \\n if (rheadersParam == '1'){\\n let rawRecvHeader = [];\\n rawRecvHeader = sourceLeg.protocolInfo.recvHeader.split(\\\"\\\\r\\\\n\\\")\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t;\\n let recvAttributes = []; \\n\\n rawRecvHeader.forEach(function (item,index){\\n if (index !=0){\\n let attribObj = {}; \\n let n = item.indexOf(\\\":\\\");\\n let attribName = item.substr(0,n).toString();\\n let atrribValue = (item.substr(n+1).trim());\\n if (attribName.length != 0) {\\n attribObj[attribName]= atrribValue; \\n recvAttributes.push(attribObj);\\n }\\n }\\n });\\n resultLeg.rheaders = recvAttributes;\\n } else if (rheadersParam == '0'){ \\n resultLeg.rheaders = null;\\n } else {\\n // No rheaders elemenmt at all\\n }\\n\\n\\n // Formatting the sHeaders\\n \\n\\t if (sheadersParam == '1') {\\n let rawSendHeader = [];\\n rawSendHeader = sourceLeg.protocolInfo.sentHeader.split(\\\"\\\\r\\\\n\\\")\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t;\\n let sendAttributes = []; \\n\\n rawSendHeader.forEach(function (item,index){\\n if (index !=0){\\n let attribObj = {}; \\n let n = item.indexOf(\\\":\\\");\\n let attribName = item.substr(0,n).toString();\\n let atrribValue = (item.substr(n+1).trim());\\n if (attribName.length != 0) {\\n attribObj[attribName]= atrribValue; \\n sendAttributes.push(attribObj);\\n }\\n }\\n });\\n\\n resultLeg.sheaders = sendAttributes;\\n } else if (sheadersParam == '0') {\\n resultLeg.sheaders = null;\\n } else {\\n // No sheaders element at all\\n }\\n\\n\\t // Only when all legs are requested create an Array with leg objects.\\n // Otherwise just return the leg object.\\n\\t if (legParam == '*') {\\n \\tresultLegs.push(resultLeg);\\n } else {\\n return resultLeg;\\n }\\n\\n }\\n }\\n\\n \\n return resultLegs;\"",
233233
"metaName": "code",
234-
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
234+
"metaDescription": "A JavaScript function body. Supports `await` and returning promises."
235235
}
236236
],
237237
"outputs": {
@@ -261,7 +261,7 @@
261261
"name": "status",
262262
"type": "number",
263263
"value": "500",
264-
"metaName": "status",
264+
"metaName": "Status",
265265
"metaDescription": "The HTTP status code"
266266
}
267267
],
@@ -283,14 +283,14 @@
283283
"name": "status",
284284
"type": "number",
285285
"value": "400",
286-
"metaName": "status",
286+
"metaName": "Status",
287287
"metaDescription": "The HTTP status code"
288288
},
289289
{
290290
"name": "body",
291291
"type": "jsonpath",
292292
"value": "$.error.message",
293-
"metaName": "body",
293+
"metaName": "Body",
294294
"metaDescription": "The response payload"
295295
}
296296
],

0 commit comments

Comments
 (0)