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

Commit 34c801b

Browse files
author
Chris Wiechmann
committed
Added an extra check to avoid NPE in OpenTraffic-Pipeline
Solves issue #101
1 parent 6014c75 commit 34c801b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99
- TransactionData not shown, if TransactionElement legs are not in a row [#97](https://github.com/Axway-API-Management-Plus/apigateway-openlogging-elk/issues/97)
1010
- Already existing ServiceName and Operation (Policy-Based) is removed during API-Lookup, when native API cannot be looked up [#98](https://github.com/Axway-API-Management-Plus/apigateway-openlogging-elk/issues/98)
1111
- Data is deleted too early - Data is not visible anymore after ap. 7 days [#99](https://github.com/Axway-API-Management-Plus/apigateway-openlogging-elk/issues/99)
12+
- Logstash Pipeline crashes with NullPointerException in some cases [#101](https://github.com/Axway-API-Management-Plus/apigateway-openlogging-elk/issues/101)
1213

1314
### Added
1415
- Added a new parameter: `DISABLE_CUSTOM_PROPERTIES` to disable custom properties support [#95](https://github.com/Axway-API-Management-Plus/apigateway-openlogging-elk/issues/95)

logstash/pipelines/OpenTrafficPipeline.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,9 @@ filter {
287287
remove_field => ["transactionElements"]
288288
}
289289
# For some requests (OPTIONS, some native calls) the finalStatus is not set - Set it based on the http.status
290+
# Extra check, if field [http][status] exists is a must (See https://github.com/elastic/logstash/issues/11917)
290291
if( ![finalStatus] ) {
291-
if ([http][status] >= 200 and [http][status] <= 299 ) {
292+
if ([http][status] and [http][status] >= 200 and [http][status] <= 299 ) {
292293
mutate { add_field => { "[finalStatus]" => "Pass" } }
293294
} else {
294295
mutate { add_field => { "[finalStatus]" => "Fail" } }

0 commit comments

Comments
 (0)