github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/internal/operator/boom/application/applications/apigateway/logs/logs.go (about) 1 package logs 2 3 import ( 4 "github.com/caos/orbos/internal/operator/boom/application/applications/logcollection/logging" 5 ) 6 7 func getLabels() map[string]string { 8 return map[string]string{ 9 "app.kubernetes.io/instance": "ambassador", 10 "app.kubernetes.io/name": "ambassador", 11 } 12 } 13 14 func GetFlow(outputs []string, clusterOutputs []string) *logging.FlowConfig { 15 return &logging.FlowConfig{ 16 Name: "flow-ambassador", 17 Namespace: "caos-system", 18 SelectLabels: getLabels(), 19 Outputs: outputs, 20 ClusterOutputs: clusterOutputs, 21 ParserType: "logfmt", 22 ParserExpression: "", 23 } 24 } 25 26 func GetCloudFlow(outputs []string, clusterOutputs []string) *logging.FlowConfig { 27 return &logging.FlowConfig{ 28 Name: "flow-cloud-ambassador", 29 Namespace: "caos-system", 30 SelectLabels: getLabels(), 31 Outputs: outputs, 32 ClusterOutputs: clusterOutputs, 33 ParserType: "regexp", 34 ParserExpression: "^(?<type>\\S+) \\[(?<time>[^\\]]*)\\] \"(?<method>\\S+)(?: +(?<path>(?:[^\\\"]|\\\\.)*?)(?: +\\S*)?) (?<protocol>\\S+)?\" (?<response_code>\\S+) (?<response_flags>\\S+) (?<bytes_received>\\S+) (?<bytes_sent>\\S+) (?<duration>\\S+) (?<x_envoy_upstream_service_time>\\S+) \"(?<x_forwarded_for>[^\\\"]*)\" \"(?<user_agent>[^\\\"]*)\" \"(?<x_request_id>[^\\\"]*)\" \"(?<authority>[^\\\"]*)\" \"(?<upstream_host>[^\\\"]*)\"", 35 } 36 }