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

Commit 6006416

Browse files
author
Chris Wiechmann
committed
Merge branch 'master' of https://github.com/mpentzek/apigateway-openlogging-elk into mpentzek-master
2 parents 4d5ead5 + d87ee75 commit 6006416

File tree

7 files changed

+489
-8
lines changed

7 files changed

+489
-8
lines changed

elk-traffic-monitor-api/endpoints/trafficMonitorApi.json

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,106 @@
7575
"required": true
7676
}
7777
]
78+
},
79+
"/router/service/{serviceID}/ops/stream/{transactionID}/*/circuitpath": {
80+
"get": {
81+
"summary": "Retrieves circuitpath information",
82+
"tags": [],
83+
"responses": {
84+
"200": {
85+
"description": "OK",
86+
"schema": {
87+
"type": "object",
88+
"properties": {}
89+
}
90+
}
91+
},
92+
"operationId": "circuitpath",
93+
"description": "Retrieves information about the policy filters associated with the specified transactionID and serviceID",
94+
"x-flow": "trafficMonitorApi-circuitpath"
95+
},
96+
"parameters": [
97+
{
98+
"type": "string",
99+
"name": "serviceID",
100+
"in": "path",
101+
"required": true,
102+
"description": "instance of the API Gateway e.g.instance-1"
103+
},
104+
{
105+
"type": "string",
106+
"name": "transactionID",
107+
"in": "path",
108+
"required": true,
109+
"description": "identifies the transaction"
110+
}
111+
]
112+
},
113+
"/router/service/{serviceID}/ops/{protocol}/{correlationID}/{legID}/getinfo": {
114+
"get": {
115+
"summary": "Retrieves event information",
116+
"tags": [],
117+
"responses": {
118+
"200": {
119+
"description": "OK",
120+
"schema": {
121+
"type": "object",
122+
"properties": {}
123+
}
124+
}
125+
},
126+
"operationId": "getinfo",
127+
"x-flow": "trafficMonitorApi-getinfo",
128+
"parameters": [
129+
{
130+
"type": "string",
131+
"in": "query",
132+
"name": "format"
133+
},
134+
{
135+
"type": "string",
136+
"in": "query",
137+
"name": "details"
138+
},
139+
{
140+
"type": "string",
141+
"in": "query",
142+
"name": "rheaders"
143+
},
144+
{
145+
"type": "string",
146+
"in": "query",
147+
"name": "sheaders"
148+
}
149+
],
150+
"description": "Retrieves information about events associated with the specified correlationID and legID"
151+
},
152+
"parameters": [
153+
{
154+
"type": "string",
155+
"name": "serviceID",
156+
"in": "path",
157+
"required": true
158+
},
159+
{
160+
"type": "string",
161+
"name": "protocol",
162+
"in": "path",
163+
"required": true
164+
},
165+
{
166+
"type": "string",
167+
"name": "correlationID",
168+
"in": "path",
169+
"required": true
170+
},
171+
{
172+
"type": "string",
173+
"name": "legID",
174+
"in": "path",
175+
"required": true
176+
}
177+
]
78178
}
79179
},
80180
"basePath": "/elk/v1/api"
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{
2+
"schemaVersion": "4",
3+
"info": {
4+
"name": "trafficMonitorApi - get /router/service/{serviceID}/ops/stream/{correlationID}/*/circuitpath"
5+
},
6+
"parameter": {
7+
"properties": {
8+
"params": {
9+
"type": "object",
10+
"description": "The parameters from the endpoint."
11+
},
12+
"request": {
13+
"type": "object",
14+
"description": "The HTTP request."
15+
},
16+
"config": {
17+
"type": "object",
18+
"description": "The service's configuration"
19+
},
20+
"env": {
21+
"type": "object",
22+
"description": "The host OS environment"
23+
}
24+
},
25+
"additionalProperties": false,
26+
"required": [
27+
"params",
28+
"request",
29+
"config",
30+
"env"
31+
]
32+
},
33+
"start": "condition.1",
34+
"nodes": {
35+
"setcontext.1": {
36+
"type": "nodehandler://axway-flow/setcontext",
37+
"name": "Healthcheck API",
38+
"method": "setcontext",
39+
"parameters": [
40+
{
41+
"name": "value",
42+
"type": "array",
43+
"value": "[\n\t{\n\t\t\"policy\": \"Health Check\",\n\t\t\"execTime\": 3,\n\t\t\"filters\": [\n\t\t\t{\n\t\t\t\t\"espk\": \"DEFAULT_PRIMARY_VordelGateway_7.7.0:-1095086795812854131\",\n\t\t\t\t\"name\": \"Set Message\",\n\t\t\t\t\"type\": \"ChangeMessageFilter\",\n\t\t\t\t\"class\": \"com.vordel.circuit.conversion.ChangeMessageFilter\",\n\t\t\t\t\"status\": \"Pass\",\n\t\t\t\t\"filterTime\": 1588666217698,\n\t\t\t\t\"execTime\": 3\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"espk\": \"DEFAULT_PRIMARY_VordelGateway_7.7.0:-4282446533257395104\",\n\t\t\t\t\"name\": \"Reflect\",\n\t\t\t\t\"type\": \"ReflectFilter\",\n\t\t\t\t\"class\": \"com.vordel.circuit.net.ReflectFilter\",\n\t\t\t\t\"status\": \"Pass\",\n\t\t\t\t\"filterTime\": 1588666217698,\n\t\t\t\t\"execTime\": 0\n\t\t\t}\n\t\t]\n\t}\n]",
44+
"metaName": "value"
45+
}
46+
],
47+
"outputs": {
48+
"next": {
49+
"context": "$.circuit_payload",
50+
"routes": [
51+
"http.1"
52+
],
53+
"metaName": "Next"
54+
}
55+
},
56+
"metaMethod": "Set Context"
57+
},
58+
"http.1": {
59+
"type": "nodehandler://axway-flow/http",
60+
"name": "Set HTTP Response",
61+
"method": "setresponse",
62+
"parameters": [
63+
{
64+
"name": "status",
65+
"type": "number",
66+
"value": "200",
67+
"metaName": "status",
68+
"metaDescription": "The HTTP status code"
69+
},
70+
{
71+
"name": "body",
72+
"type": "jsonpath",
73+
"value": "$.circuit_payload",
74+
"metaName": "body",
75+
"metaDescription": "The response payload"
76+
}
77+
],
78+
"outputs": {
79+
"next": {
80+
"context": "$.response",
81+
"routes": [],
82+
"metaName": "Next"
83+
}
84+
},
85+
"metaMethod": "Set HTTP Response"
86+
},
87+
"condition.1": {
88+
"type": "nodehandler://axway-flow/condition",
89+
"name": "Equals",
90+
"method": "equals",
91+
"parameters": [
92+
{
93+
"name": "source",
94+
"type": "jsonpath",
95+
"value": "$.params.transactionID",
96+
"metaName": "source",
97+
"metaDescription": "The input to test."
98+
},
99+
{
100+
"name": "value",
101+
"type": "string",
102+
"value": "\"c8705e5ecc00adca32be7472\"",
103+
"metaName": "value",
104+
"metaDescription": "The value to test input against."
105+
}
106+
],
107+
"outputs": {
108+
"true": {
109+
"routes": [
110+
"setcontext.1"
111+
],
112+
"context": "$.equals",
113+
"metaName": "True"
114+
},
115+
"false": {
116+
"routes": [
117+
"setcontext.2"
118+
],
119+
"context": "$.equals",
120+
"metaName": "False"
121+
}
122+
},
123+
"metaMethod": "Equals"
124+
},
125+
"setcontext.2": {
126+
"type": "nodehandler://axway-flow/setcontext",
127+
"name": "ToDo API",
128+
"method": "setcontext",
129+
"parameters": [
130+
{
131+
"name": "value",
132+
"type": "array",
133+
"value": "[\n\t{\n\t\t\"policy\": \"API Broker\",\n\t\t\"execTime\": 721,\n\t\t\"filters\": [\n\t\t\t{\n\t\t\t\t\"name\": \"Set service context\",\n\t\t\t\t\"type\": \"VApiServiceContextFilter\",\n\t\t\t\t\"class\": \"com.vordel.circuit.vapi.VApiServiceContextFilter\",\n\t\t\t\t\"status\": \"Pass\",\n\t\t\t\t\"filterTime\": 1588798042453,\n\t\t\t\t\"execTime\": 5\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"Global Request Policy\",\n\t\t\t\t\"type\": \"CircuitDelegateFilter\",\n\t\t\t\t\"class\": \"com.vordel.circuit.CircuitDelegateFilter\",\n\t\t\t\t\"status\": \"Pass\",\n\t\t\t\t\"filterTime\": 1588798042464,\n\t\t\t\t\"execTime\": 9,\n\t\t\t\t\"subPaths\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"policy\": \"Trace\",\n\t\t\t\t\t\t\"execTime\": 9,\n\t\t\t\t\t\t\"filters\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"espk\": \"DEFAULT_PRIMARY_VordelGateway_7.7.0:-2330724604838128298\",\n\t\t\t\t\t\t\t\t\"name\": \"Trace Filter\",\n\t\t\t\t\t\t\t\t\"type\": \"TraceFilter\",\n\t\t\t\t\t\t\t\t\"class\": \"com.vordel.circuit.basic.TraceFilter\",\n\t\t\t\t\t\t\t\t\"status\": \"Pass\",\n\t\t\t\t\t\t\t\t\"filterTime\": 1588798042464,\n\t\t\t\t\t\t\t\t\"execTime\": 9\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"Custom Routing\",\n\t\t\t\t\"type\": \"VApiCircuitDelegateFilter\",\n\t\t\t\t\"class\": \"com.vordel.apiportal.runtime.virtualized.VApiCircuitDelegateFilter\",\n\t\t\t\t\"status\": \"Pass\",\n\t\t\t\t\"filterTime\": 1588798043171,\n\t\t\t\t\"execTime\": 707,\n\t\t\t\t\"subPaths\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"policy\": \"Default API Proxy Routing\",\n\t\t\t\t\t\t\"execTime\": 707,\n\t\t\t\t\t\t\"filters\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"espk\": \"DEFAULT_PRIMARY_VordelGateway_7.7.0:4323849261363416160\",\n\t\t\t\t\t\t\t\t\"name\": \"Default Routing\",\n\t\t\t\t\t\t\t\t\"type\": \"SwitchFilter\",\n\t\t\t\t\t\t\t\t\"class\": \"com.vordel.circuit.switchcase.SwitchFilter\",\n\t\t\t\t\t\t\t\t\"status\": \"Pass\",\n\t\t\t\t\t\t\t\t\"filterTime\": 1588798043171,\n\t\t\t\t\t\t\t\t\"execTime\": 707,\n\t\t\t\t\t\t\t\t\"subPaths\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"policy\": \"Default API Proxy Routing\",\n\t\t\t\t\t\t\t\t\t\t\"execTime\": 674,\n\t\t\t\t\t\t\t\t\t\t\"filters\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": \"not-required-here\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"CircuitDelegateFilter\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"class\": \"com.vordel.circuit.CircuitDelegateFilter\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"status\": \"Pass\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"filterTime\": 1588798043171,\n\t\t\t\t\t\t\t\t\t\t\t\t\"execTime\": 674,\n\t\t\t\t\t\t\t\t\t\t\t\t\"subPaths\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"policy\": \"Default Profile-based Routing\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"execTime\": 674,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"filters\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"espk\": \"DEFAULT_PRIMARY_VordelGateway_7.7.0:5735607394361826155\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": \"Connect to URL\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": \"ConnectToURLFilter\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"class\": \"com.vordel.circuit.net.ConnectToURLFilter\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status\": \"Pass\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"filterTime\": 1588798043171,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"execTime\": 674\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t}\n]",
134+
"metaName": "value"
135+
}
136+
],
137+
"outputs": {
138+
"next": {
139+
"context": "$.circuit_payload",
140+
"routes": [
141+
"http.1"
142+
],
143+
"metaName": "Next"
144+
}
145+
},
146+
"metaMethod": "Set Context"
147+
}
148+
}
149+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"schemaVersion": "4",
3+
"info": {
4+
"name": "trafficMonitorApi - get /router/service/{serviceID}/ops/{protocol}/{correlationID}/{legID}/getinfo"
5+
},
6+
"parameter": {
7+
"properties": {
8+
"params": {
9+
"type": "object",
10+
"description": "The parameters from the endpoint."
11+
},
12+
"request": {
13+
"type": "object",
14+
"description": "The HTTP request."
15+
},
16+
"config": {
17+
"type": "object",
18+
"description": "The service's configuration"
19+
},
20+
"env": {
21+
"type": "object",
22+
"description": "The host OS environment"
23+
}
24+
},
25+
"additionalProperties": false,
26+
"required": [
27+
"params",
28+
"request",
29+
"config",
30+
"env"
31+
]
32+
},
33+
"start": "setcontext.1",
34+
"nodes": {
35+
"setcontext.1": {
36+
"type": "nodehandler://axway-flow/setcontext",
37+
"name": "Set Context",
38+
"method": "setcontext",
39+
"parameters": [
40+
{
41+
"name": "value",
42+
"type": "array",
43+
"value": "[\n\n{\n\t\"details\": {\"uri\":\"/healthcheck\",\"status\":200,\"statustext\":\"OK\",\"method\":\"GET\",\"vhost\":null,\"wafStatus\":0,\"bytesSent\":1331,\"bytesReceived\":1233,\"remoteName\":\"192.168.233.1\",\"remoteAddr\":\"192.168.233.1\",\"localAddr\":\"192.168.233.137\",\"remotePort\":\"57400\",\"localPort\":\"8080\",\"sslsubject\":null,\"leg\":0,\"timestamp\":1588666217689,\"duration\":49,\"correlationId\":\"691fb15ed40003055c0ea6f0\",\"serviceName\":null,\"subject\":null,\"operation\":null,\"type\":\"http\",\"finalStatus\":\"Pass\"\n\t},\n\t\"rheaders\": [\n{ \"Host\":\"api-env.demo.axway.com:8080\"},\n{ \"Connection\":\"keep-alive\"},\n{ \"Upgrade-Insecure-Requests\":\"1\"},\n{ \"User-Agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36\"},\n{ \"Accept\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\"},\n{ \"Accept-Encoding\":\"gzip, deflate\"},\n{ \"Accept-Language\":\"de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7\"},\n{ \"Cookie\":\"_ga=GA1.2.2089149224.1588233255; _hjid=45582ae7-17d6-4d5b-be7d-891a307d4109; _gcl_au=1.1.169451176.1588238948; _mkto_trk=id:727-TDV-465&token:_mch-axway.com-1588238948318-18018; _fbp=fb.1.1588238949560.1566065746; mousestats_vi=2f25c2ce7a7dc21cdb83; _gaexp=GAX1.2.8iCZUhMtRFiOOhBG7oZNyg.18455.1; wisepops_visits=%5B%222020-04-30T09%3A31%3A36.972Z%22%2C%222020-04-30T09%3A31%3A24.285Z%22%5D; wisepops=%7B%22csd%22%3A1%2C%22popups%22%3A%7B%22201026%22%3A%7B%22dc%22%3A1%2C%22d%22%3A%222020-04-30T09%3A31%3A24.876Z%22%7D%2C%22202147%22%3A%7B%22dc%22%3A1%2C%22d%22%3A%222020-04-30T09%3A31%3A37.237Z%22%7D%7D%2C%22sub%22%3A0%2C%22ucrn%22%3A90%2C%22cid%22%3A%2248348%22%2C%22v%22%3A4%7D; portal.logintypesso=false; portal.demo=off; portal.isgridSortIgnoreCase=on\"}\n\t],\n\t\"sheaders\": [\n{ \"Date\":\"Tue, 05 May 2020 08:10:17 GMT\"},\n{ \"Server\":\"Gateway\"},\n{ \"Connection\":\"close\"},\n{ \"X-CorrelationID\":\"Id-691fb15ed40003055c0ea6f0 0\"},\n{ \"Accept\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\"},\n{ \"Accept-Language\":\"de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7\"},\n{ \"Cookie\":\"_ga=GA1.2.2089149224.1588233255; _hjid=45582ae7-17d6-4d5b-be7d-891a307d4109; _gcl_au=1.1.169451176.1588238948; _mkto_trk=id:727-TDV-465&token:_mch-axway.com-1588238948318-18018; _fbp=fb.1.1588238949560.1566065746; mousestats_vi=2f25c2ce7a7dc21cdb83; _gaexp=GAX1.2.8iCZUhMtRFiOOhBG7oZNyg.18455.1; wisepops_visits=%5B%222020-04-30T09%3A31%3A36.972Z%22%2C%222020-04-30T09%3A31%3A24.285Z%22%5D; wisepops=%7B%22csd%22%3A1%2C%22popups%22%3A%7B%22201026%22%3A%7B%22dc%22%3A1%2C%22d%22%3A%222020-04-30T09%3A31%3A24.876Z%22%7D%2C%22202147%22%3A%7B%22dc%22%3A1%2C%22d%22%3A%222020-04-30T09%3A31%3A37.237Z%22%7D%7D%2C%22sub%22%3A0%2C%22ucrn%22%3A90%2C%22cid%22%3A%2248348%22%2C%22v%22%3A4%7D; portal.logintypesso=false; portal.demo=off; portal.isgridSortIgnoreCase=on\"},\n{ \"Host\":\"api-env.demo.axway.com:8080\"},\n{ \"Upgrade-Insecure-Requests\":\"1\"},\n{ \"User-Agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36\"},\n{ \"Content-Type\":\"text/xml\"}\n\t]\n}]",
44+
"metaName": "value"
45+
}
46+
],
47+
"outputs": {
48+
"next": {
49+
"context": "$.GetInfoPayload",
50+
"routes": [
51+
"http.1"
52+
],
53+
"metaName": "Next"
54+
}
55+
},
56+
"metaMethod": "Set Context"
57+
},
58+
"http.1": {
59+
"type": "nodehandler://axway-flow/http",
60+
"name": "Set HTTP Response",
61+
"method": "setresponse",
62+
"parameters": [
63+
{
64+
"name": "status",
65+
"type": "number",
66+
"value": "200",
67+
"metaName": "status",
68+
"metaDescription": "The HTTP status code"
69+
},
70+
{
71+
"name": "body",
72+
"type": "jsonpath",
73+
"value": "$.GetInfoPayload",
74+
"metaName": "body",
75+
"metaDescription": "The response payload"
76+
}
77+
],
78+
"outputs": {
79+
"next": {
80+
"context": "$.response",
81+
"routes": [],
82+
"metaName": "Next"
83+
}
84+
},
85+
"metaMethod": "Set HTTP Response"
86+
}
87+
}
88+
}

elk-traffic-monitor-api/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929
"homepage": "https://github.com/cwiechmann/apigateway-openlogging-elk",
3030
"dependencies": {
3131
"@axway-api-builder-ext/api-builder-plugin-fn-elasticsearch": "^1.0.3",
32-
"@axway/api-builder-plugin-fn-base64": "^2.0.0",
33-
"@axway/api-builder-plugin-fn-javascript": "^1.0.0",
34-
"@axway/api-builder-plugin-fn-json": "^2.0.0",
35-
"@axway/api-builder-plugin-fn-mustache": "^1.0.1",
36-
"@axway/api-builder-plugin-fn-restclient": "^2.0.0",
37-
"@axway/api-builder-plugin-fn-swagger": "^2.0.0",
38-
"@axway/api-builder-runtime": "^4.22.0"
32+
"@axway/api-builder-plugin-fn-base64": "^2.1.3",
33+
"@axway/api-builder-plugin-fn-javascript": "^1.2.5",
34+
"@axway/api-builder-plugin-fn-json": "^2.0.15",
35+
"@axway/api-builder-plugin-fn-mustache": "^1.0.5",
36+
"@axway/api-builder-plugin-fn-restclient": "^2.0.21",
37+
"@axway/api-builder-plugin-fn-swagger": "^2.7.4",
38+
"@axway/api-builder-runtime": "^4.27.10"
3939
},
4040
"devDependencies": {
41-
"@axway/api-builder-admin": "^1.10.10",
41+
"@axway/api-builder-admin": "^1.16.2",
4242
"chai": "^4.2.0",
4343
"mocha": "^7.1.2"
4444
},

0 commit comments

Comments
 (0)