@@ -8,19 +8,39 @@ input {
88}
99
1010filter {
11+ # The logtype has been set by Filebeat to distinct between OpenLog and TraceLog
1112 if ([fields][logtype] == "openlog") {
13+ # Parse the received payload into a JSON-Object
1214 json {
1315 source => "[message]"
1416 target => "[message]"
1517 }
16-
18+ # Use the given timestamp from OpenLog for the logstash timestamp send to ElasticSearch
1719 date {
1820 match => [ "timestamp", "UNIX_MS" ]
1921 target => "timestampOriginal"
2022 }
21-
23+ # OpenLog contains multiple events for one transaction
24+ # Events are received for the following categories
25+ # - circuitPath - Contains details of the circuit paths executed during a transaction
26+ # - transactionSummary - Contains the high-level summary details of a transaction
27+ # - transactionElement - Contains detailed information for an indvidual element (leg) of a transaction
28+ # - trace - Contains a single trace message generated by an API Gateway process
29+ # In this aggregation both are joined together into one document before it is send to ElasticSearch
30+ # https://docs.axway.com/bundle/APIGateway_762_AdministratorGuide_allOS_en_HTML5/page/Content/AdminGuideTopics/admin_open_logging.htm
31+ # IT IS IMPORTANT, that
2232 aggregate {
33+ # Map different events based on the correlationId
2334 task_id => "%{correlationId}"
35+ # Related events are expected to be received with a delay of 10 seconds
36+ timeout => 10
37+ # On timeout (after 10 seconds) send the received event anyway.
38+ push_map_as_event_on_timeout => true
39+ # The following code is basically
40+ # - Handles all types besides trace
41+ # - Takes over the common information such as correlationId, timestampOriginal, ...
42+ # - Initializes the transactionElements
43+ # - takes over individual fields from the event into the aggregated map
2444 code => "
2545 map['correlationId'] ||= event.get('correlationId')
2646 map['timestampOriginal'] ||= event.get('timestampOriginal')
@@ -51,10 +71,8 @@ filter {
5171
5272 event.cancel()
5373 "
54- push_map_as_event_on_timeout => true
55- timeout => 5
5674 }
57-
75+ # Indicate in the outgoing event this is an openlog event
5876 mutate {
5977 add_tag => [ "openlog" ]
6078 }
0 commit comments