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

Commit 3452871

Browse files
author
Chris Wiechmann
committed
The transactionSummary.status is no longer used
as it's a duplicate of finalStatus
1 parent 9bd4f9a commit 3452871

File tree

6 files changed

+23
-12
lines changed

6 files changed

+23
-12
lines changed

apibuilder4elastic/test/documents/filetransfer/filetransfer_search_document.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ module.exports = [
55
{
66
"@timestamp": "2020-09-02T20:10:50.348Z",
77
"correlationId": "4afc4f5fa70015d93db3a15c",
8-
"finalStatus": "success",
8+
"finalStatus": "Pass",
99
"duration": 924,
1010
"path": null,
1111
"protocol": "ftp-local",
1212
"protocolSrc": "10021//opt/Axway/APIM-7.7.0/apigateway/groups/group-2/instance-1/file-transfer/in/persistent/abc",
13-
"status": "success",
1413
"serviceContext": null,
1514
"fileTransfer": {
1615
"remoteAddr": "/192.168.65.1:63026",
@@ -34,12 +33,11 @@ module.exports = [
3433
{
3534
"@timestamp": "2020-09-02T20:10:50.348Z",
3635
"correlationId": "4afc4f5fa70015d93db-FTPS",
37-
"finalStatus": "success",
36+
"finalStatus": "Pass",
3837
"duration": 100,
3938
"path": null,
4039
"protocol": "ftp-local",
4140
"protocolSrc": "10021//opt/Axway/APIM-7.7.0/apigateway/groups/group-2/instance-1/file-transfer/in/persistent/abc",
42-
"status": "success",
4341
"serviceContext": null,
4442
"fileTransfer": {
4543
"remoteAddr": "/192.168.65.1:63026",

apibuilder4elastic/test/documents/http/search_count_documents.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ module.exports = [
1919
"protocol": "https",
2020
"serviceContext": null,
2121
"protocolSrc": "8065",
22-
"status": "failure",
2322
"finalStatus" : "Fail",
2423
"http": {
2524
"statusText": "Not Found",

apibuilder4elastic/test/documents/http/search_test_documents.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module.exports = [
1818
"path": "/favicon.ico",
1919
"protocol": "https",
2020
"serviceContext": null,
21-
"status": "failure",
2221
"duration" : 55,
2322
"finalStatus" : "Fail",
2423
"http": {

logstash/index_templates/traffic_summary_index_template.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@
6767
},
6868
"norms": false
6969
},
70-
71-
"status": {
72-
"type": "keyword"
73-
},
7470
"http.uri": {
7571
"type": "text",
7672
"norms": false

logstash/pipelines/OpenTrafficPipeline.conf

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ filter {
158158
}
159159
if([type] == 'summaryIndex') {
160160
if([transactionSummary]) {
161+
# Change status value of transactionSummary to be aligned with finalStatus
162+
translate {
163+
field => "[transactionSummary][status]"
164+
destination => "[transactionSummary][finalStatus]"
165+
dictionary => {
166+
"success" => "Pass"
167+
"failure" => "Fail"
168+
"exception" => "Error"
169+
}
170+
remove_field => "[transactionSummary][status]"
171+
}
161172
# Place all transactionSummary information directlly into the root
162173
# The path is skipped, as it is duplicated with http.uri and not available for all kind of events
163174
ruby {
@@ -184,7 +195,7 @@ filter {
184195
]
185196
}
186197
ruby {
187-
# This copies all kind of traffic (http, filetransfer, ...)
198+
# This copies all kind of traffic (http, filetransfer, ...) to the root of the document (e.g. http.status, http.uri, ...)
188199
code => '
189200
event.get("[transactionElements][leg0][protocolInfo]").each { |k, v|
190201
event.set(k,v)
@@ -197,6 +208,14 @@ filter {
197208
# Once we have copied - we can remove the original information from the summaryIndex event
198209
remove_field => ["transactionElements"]
199210
}
211+
# For some requests (OPTIONS, some native calls) the finalStatus is not set - Set it based on the http.status
212+
if( ![finalStatus] ) {
213+
if ([http][status] >= 200 and [http][status] <= 299 ) {
214+
mutate { add_field => { "[finalStatus]" => "Pass" } }
215+
} else {
216+
mutate { add_field => { "[finalStatus]" => "Fail" } }
217+
}
218+
}
200219
}
201220
}
202221
}

logstash/test/http/test-opentrafficlog.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@
607607
"leg0": {
608608
"duration": 2,
609609
"leg": 0,
610-
"finalStatus": null,
610+
"finalStatus": "Pass",
611611
"protocolInfo": {
612612
"http": {
613613
"uri": "/WebShop.svc",

0 commit comments

Comments
 (0)