@@ -8,19 +8,39 @@ input {
8
8
}
9
9
10
10
filter {
11
+ # The logtype has been set by Filebeat to distinct between OpenLog and TraceLog
11
12
if ([fields][logtype] == "openlog") {
13
+ # Parse the received payload into a JSON-Object
12
14
json {
13
15
source => "[message]"
14
16
target => "[message]"
15
17
}
16
-
18
+ # Use the given timestamp from OpenLog for the logstash timestamp send to ElasticSearch
17
19
date {
18
20
match => [ "timestamp", "UNIX_MS" ]
19
21
target => "timestampOriginal"
20
22
}
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
22
32
aggregate {
33
+ # Map different events based on the correlationId
23
34
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
24
44
code => "
25
45
map['correlationId'] ||= event.get('correlationId')
26
46
map['timestampOriginal'] ||= event.get('timestampOriginal')
@@ -51,10 +71,8 @@ filter {
51
71
52
72
event.cancel()
53
73
"
54
- push_map_as_event_on_timeout => true
55
- timeout => 5
56
74
}
57
-
75
+ # Indicate in the outgoing event this is an openlog event
58
76
mutate {
59
77
add_tag => [ "openlog" ]
60
78
}
0 commit comments