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

Commit a915d94

Browse files
author
Chris Wiechmann
committed
Finalized Error-Handling for Logstash processing
1 parent 47f8c0c commit a915d94

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

logstash/config/traffic_details_index_template.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"index_patterns": [
3-
"apigw-traffic-details-*"
3+
"apigw-traffic-details-*",
4+
"apigw-traffic-errors-*"
45
],
56
"settings": {
67
"number_of_shards": 5,

logstash/pipeline/pipeline.conf

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,17 @@ filter {
8080
clone {
8181
clones => ['errorEvent']
8282
}
83-
# Fill the URI based on the given path to have it shown in Traffic-Monitor
84-
mutate { add_field => { "[transactionElements][leg0][protocolInfo][http][uri]" => "%{[transactionSummary][path]}" } }
85-
mutate { replace => { "[transactionElements][leg0][protocolInfo][http][status]" => "XXX" } }
86-
mutate { replace => { "[transactionElements][leg0][protocolInfo][http][statusText]" => "ERROR" } }
87-
mutate { replace => { "[transactionElements][leg0][protocolInfo][http][authSubjectId]" => "ID: %{[correlationId]}" } }
88-
mutate { replace => { "[transactionSummary][serviceContext][vhost]" => "Logstash Error" } }
89-
mutate { replace => { "[transactionSummary][serviceContext][method]" => "check the logs" } }
83+
if [type] == 'errorEvent' {
84+
# Fill the URI based on the given path to have it shown in Traffic-Monitor
85+
mutate { add_field => { "[correlationId]" => "-Error" } }
86+
mutate { add_field => { "[transactionElements][leg0][protocolInfo][http][uri]" => "%{[transactionSummary][path]}" } }
87+
mutate { replace => { "[transactionElements][leg0][protocolInfo][http][vhost]" => "Logstash Error" } }
88+
mutate { replace => { "[transactionElements][leg0][protocolInfo][http][method]" => "LOGSTASH" } }
89+
mutate { replace => { "[transactionElements][leg0][protocolInfo][http][status]" => "900" } }
90+
mutate { replace => { "[transactionElements][leg0][protocolInfo][http][statusText]" => "ERROR" } }
91+
mutate { replace => { "[transactionElements][leg0][protocolInfo][http][authSubjectId]" => "ID: %{[correlationId]}" } }
92+
mutate { replace => { "[transactionSummary][serviceContext][method]" => "check the logs" } }
93+
}
9094
}
9195
}
9296
#}

logstash/test/test-openlog-events.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
},
139139
{
140140
"@timestamp": "2020-07-13T20:07:27.467Z",
141-
"correlationId": "OMG-UNKNOWN-API",
141+
"correlationId": "OMG-UNKNOWN-API-Error",
142142
"logtype": "openlog",
143143
"processInfo": {
144144
"hostname": "ip-172-31-62-146.ec2.internal",

0 commit comments

Comments
 (0)