2 # Copyright © 2018 AT&T, Amdocs, Bell Canada Intellectual Property. All rights reserved.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 ## Add a id to plugin configuration. Can be anything unique.
22 ######## Connection configurations ########
24 ## The port to listen on.
25 port => {{.Values.service.externalPort}}
27 ## Close Idle clients after the specified time in seconds. Default is 60 seconds
28 #client_inactivity_timeout => 60
30 ######## Security configurations ########
32 ## Enable encryption. Default false.
35 ## ssl certificate path.
36 #ssl_certificate => $filebeat_ssl_certificate
39 #ssl_key => $filebeat_ssl_key
41 ##SSL key passphrase to use.
42 #ssl_key_passphrase => $filebeat_ssl_key_passphrase
44 ## Value can be any of: none, peer, force_peer.
45 #ssl_verify_mode => $filebeat_ssl_verify_mode
47 ## Time in milliseconds for an incomplete ssl handshake to timeout. Default is 10000 ms.
48 #ssl_handshake_timeout => 10000
49 include_codec_tag => false
56 break_on_match => false
58 "source" => ["/var/log/onap/(?<componentName>[^/]+)/",
59 "/var/log/onap/%{GREEDYDATA:componentLogFile}"
64 # Filter for log4j xml events
65 if "</log4j:event>" in [message] {
67 #mutate { add_field => { "orgmsg_log4j" => "%{message}" } } # Copy of orginal msg for debug
69 #Filter to parse xml event and retrieve data
73 remove_namespaces => true
74 target => "xml_content"
75 xpath => [ "/event/message/text()", "logmsg" ,
76 "/event/@logger", "Logger",
77 "/event/@timestamp", "Timestamp",
78 "/event/@level", "loglevel",
79 "/event/@thread", "Thread",
80 "/event/throwable/text()", "Exceptionthrowable",
81 "/event/NDC/text()", "NDCs",
82 "/event/properties/data/@name","mdcname",
83 "/event/properties/data/@value","mdcvalue"]
87 #Ruby filter to iterate and separate MDCs into documents
92 if event.get("[mdcname]")
93 $num = event.get("[mdcname]").length
97 if event.get("[mdcname]").at($i) and event.get("[mdcvalue]").at($i)
98 event.set(event.get("[mdcname]").at($i), event.get("[mdcvalue]").at($i))
107 if [Exceptionthrowable]
111 "exceptionmessage" => "%{[Exceptionthrowable]}"
127 "Logger" =>"%{[Logger]}"
128 "logmsg" =>"%{[logmsg]}"
129 "Timestamp" =>"%{[Timestamp]}"
130 "loglevel" =>"%{[loglevel]}"
131 "message" => "%{logmsg}"
132 "Thread" => "%{[Thread]}"
134 remove_field => ["mdcname", "mdcvalue", "logmsg","Exceptionthrowable","NDCs"]
140 match => ["Timestamp", "UNIX_MS"]
141 target => "Timestamp"
145 # Filter for logback events
148 #mutate { add_field => { "orgmsg" => "%{message}" } } # Copy of orginal msg for debug
152 'message', ' = ', '=',
153 'message', '= ', '=null',
154 'message', '=\t', '=null ', #This null is followed by a tab
155 'message', '\t$', '\t'
158 # The grok below parses the message field for all current logback patterns used by oom components.
159 # Example logback pattern: %d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", UTC}|%X{RequestId}|%msg
160 # Example grok pattern: %{TIMESTAMP_ISO8601:Timestamp}\|%{UUID:RequestId}\|%{GREEDYDATA:message}
161 # Use the following command to find all logback patterns in oom directory: find oom -name "logback*xml" -exec grep "property.*attern.*value" {} \;|sort|uniq
165 "%{TIMESTAMP_ISO8601:Timestamp}\\t[%{GREEDYDATA:Thread}]\\t%{GREEDYDATA:loglevel}\\t%{JAVACLASS:Logger}\\t%{GREEDYDATA:MDCs}\\t%{GREEDYDATA:message}",
166 "%{TIMESTAMP_ISO8601:BeginTimestamp}\|%{TIMESTAMP_ISO8601:EndTimestamp}\|%{UUID:RequestId}\|%{GREEDYDATA:ServiceInstanceId}\|%{GREEDYDATA:Thread}\|%{GREEDYDATA:Unknown1}\|%{GREEDYDATA:ServiceName}\|%{GREEDYDATA:PartnerName}\|%{GREEDYDATA:TargetEntity}\|%{GREEDYDATA:TargetServiceName}\|%{GREEDYDATA:StatusCode}\|%{GREEDYDATA:ResponseCode}\|%{GREEDYDATA:ResponseDesc}\|%{UUID:InstanceUUID}\|%{GREEDYDATA:loglevel}\|%{GREEDYDATA:AlertSeverity}\|%{IP:ServerIPAddress}\|%{GREEDYDATA:Timer}\|%{HOSTNAME:ServerFQDN}\|%{IPORHOST:RemoteHost}\|%{GREEDYDATA:Unknown2}\|%{GREEDYDATA:Unknown3}\|%{GREEDYDATA:Unknown4}\|%{GREEDYDATA:TargetVirtualEntity}\|%{GREEDYDATA:Unknown5}\|%{GREEDYDATA:Unknown6}\|%{GREEDYDATA:Unknown7}\|%{GREEDYDATA:Unknown8}\|%{GREEDYDATA:message}",
167 "%{TIMESTAMP_ISO8601:BeginTimestamp}\|%{TIMESTAMP_ISO8601:EndTimestamp}\|%{UUID:RequestId}\|%{GREEDYDATA:ServiceInstanceId}\|%{GREEDYDATA:Thread}\|%{GREEDYDATA:Unknown1}\|%{GREEDYDATA:ServiceName}\|%{GREEDYDATA:PartnerName}\|%{GREEDYDATA:StatusCode}\|%{GREEDYDATA:ResponseCode}\|%{GREEDYDATA:ResponseDesc}\|%{UUID:InstanceUUID}\|%{GREEDYDATA:loglevel}\|%{GREEDYDATA:AlertSeverity}\|%{IP:ServerIPAddress}\|%{GREEDYDATA:Timer}\|%{HOSTNAME:ServerFQDN}\|%{IPORHOST:RemoteHost}\|%{GREEDYDATA:Unknown2}\|%{GREEDYDATA:Unknown3}\|%{GREEDYDATA:Unknown4}\|%{GREEDYDATA:Unknown5}\|%{GREEDYDATA:Unknown6}\|%{GREEDYDATA:Unknown7}\|%{GREEDYDATA:Unknown8}\|%{GREEDYDATA:message}",
168 "%{TIMESTAMP_ISO8601:Timestamp}\|%{UUID:RequestId}\|%{GREEDYDATA:ServiceInstanceId}\|%{GREEDYDATA:Thread}\|%{GREEDYDATA:ServiceName}\|%{UUID:InstanceUUID}\|%{GREEDYDATA:loglevel}\|%{GREEDYDATA:AlertSeverity}\|%{IP:ServerIPAddress}\|%{HOSTNAME:ServerFQDN}\|%{IPORHOST:RemoteHost}\|%{GREEDYDATA:Timer}\|\[%{GREEDYDATA:caller}\]\|%{GREEDYDATA:message}",
169 "%{TIMESTAMP_ISO8601:Timestamp}\|%{GREEDYDATA:RequestId}\|%{GREEDYDATA:Thread}\|%{GREEDYDATA:ServiceName}\|%{GREEDYDATA:PartnerName}\|%{GREEDYDATA:TargetEntity}\|%{GREEDYDATA:TargetServiceName}\|%{GREEDYDATA:loglevel}\|%{GREEDYDATA:ErrorCode}\|%{GREEDYDATA:ErrorDesc}\|%{GREEDYDATA:message}",
170 "%{TIMESTAMP_ISO8601:Timestamp}\|%{GREEDYDATA:RequestId}\|%{GREEDYDATA:Thread}\|%{GREEDYDATA:ClassName}\|%{GREEDYDATA:message}",
171 "%{TIMESTAMP_ISO8601:Timestamp}\|%{UUID:RequestId}\|%{GREEDYDATA:message}",
172 "\[%{TIMESTAMP_ISO8601:Timestamp}\|%{LOGLEVEL:loglevel}\|%{GREEDYDATA:Logger}\|%{GREEDYDATA:Thread}\] %{GREEDYDATA:message}"
175 overwrite => ["message"]
177 # The MDCs are key value pairs that are seperated by "," or "\t". Extra space characters are trimmed from the keys and values.
183 remove_field => [ "MDCs" ]
186 if (![Timestamp] and [EndTimestamp]) {
187 mutate { add_field => { "Timestamp" => "%{EndTimestamp}" } }
190 match => [ "Timestamp", "ISO8601", "yyyy-MM-dd HH:mm:ss,SSS" ]
191 target => "Timestamp"
195 remove_field => ["DuplicateRequestID", "Unknown1", "Unknown2", "Unknown3", "Unknown4", "Unknown5", "Unknown6", "Unknown7", "Unknown8"]
198 if ([source] == "/var/log/onap/sdc/sdc-be/audit.log") {
199 #Parse kvps in message
206 #If Request Id is missing and DID is present use as RequestId
207 if (![RequestId] and [DID] =~ /.+/) {
208 mutate { add_field => { "RequestId" => "%{DID}" } }
212 } #Close else statement for logback events
220 ######### Security configurations #########
223 password => "changeme"
225 ## The .cer or .pem file to validate the server's certificate
226 #cacert => $es_cacert
228 ## The keystore used to present a certificate to the server. It can be either .jks or .p12
229 #keystore => $es_keystore
230 #keystore_password => $es_keystore_password
232 ## Enable SSL/TLS secured communication to Elasticsearch cluster.
233 ## Default is not set which in that case depends on the protocol specidfied in hosts list
236 ## Option to validate the server's certificate. Default is true
237 #ssl_certificate_verification => $es_ssl_certificate_verification
239 ## The JKS truststore to validate the server's certificate.
240 #truststore => $es_truststore
241 #truststore_password => $es_truststore_password
244 ######### Elasticsearchcluster and host configurations #########
246 ##can specify one or a list of hosts. If sniffing is set, one is enough and others will be auto-discovered
247 hosts => ["http://{{.Values.config.elasticsearchServiceName}}.{{.Release.Namespace}}:{{.Values.config.elasticsearchPort}}"]
250 ## This setting asks Elasticsearch for the list of all cluster nodes and adds them to the hosts list. Default is false.
253 ## How long to wait, in seconds, between sniffing attempts. Default is 5 seconds.
256 ## Set the address of a forward HTTP proxy.
259 ##Use this if you must run Elasticsearch behind a proxy that remaps the root path for the Elasticsearch HTTP API lives
262 ######### Elasticsearch request configurations #########
264 ## This setting defines the maximum sized bulk request Logstash will make.
267 ######### Document configurations #########
269 index => "logstash-%{+YYYY.MM.dd}"
270 document_type => "logs"
272 ## This can be used to associate child documents with a parent using the parent ID.