4 ## Add a id to plugin configuration. Can be anything unique.
7 ######## Connection configurations ########
9 ## The port to listen on.
12 ## Close Idle clients after the specified time in seconds. Default is 60 seconds
13 #client_inactivity_timeout => 60
15 ######## Security configurations ########
17 ## Enable encryption. Default false.
20 ## ssl certificate path.
21 #ssl_certificate => $filebeat_ssl_certificate
24 #ssl_key => $filebeat_ssl_key
26 ##SSL key passphrase to use.
27 #ssl_key_passphrase => $filebeat_ssl_key_passphrase
29 ## Value can be any of: none, peer, force_peer.
30 #ssl_verify_mode => $filebeat_ssl_verify_mode
32 ## Time in milliseconds for an incomplete ssl handshake to timeout. Default is 10000 ms.
33 #ssl_handshake_timeout => 10000
34 include_codec_tag => false
40 # Filter for log4j xml events
41 if "</log4j:event>" in [message] {
42 #Filter to parse xml event and retrieve data
46 remove_namespaces => true
47 target => "xml_content"
48 xpath => [ "/event/message/text()", "logmsg" ,
49 "/event/@logger", "Logger",
50 "/event/@timestamp", "Timestamp",
51 "/event/@level", "loglevel",
52 "/event/@thread", "Thread",
53 "/event/throwable/text()", "Exceptionthrowable",
54 "/event/NDC/text()", "NDCs",
55 "/event/properties/data/@name","mdcname",
56 "/event/properties/data/@value","mdcvalue"]
60 #Ruby filter to iterate and separate MDCs into documents
65 if event.get("[mdcname]")
66 $num = event.get("[mdcname]").length
70 if event.get("[mdcname]").at($i) and event.get("[mdcvalue]").at($i)
71 event.set(event.get("[mdcname]").at($i), event.get("[mdcvalue]").at($i))
80 if [Exceptionthrowable]
84 "exceptionmessage" => "%{[Exceptionthrowable]}"
100 "Logger" =>"%{[Logger]}"
101 "logmsg" =>"%{[logmsg]}"
102 "Timestamp" =>"%{[Timestamp]}"
103 "loglevel" =>"%{[loglevel]}"
104 "message" => "%{logmsg}"
105 "Thread" => "%{[Thread]}"
107 remove_field => ["mdcname", "mdcvalue", "logmsg","Exceptionthrowable","NDCs"]
113 match => ["Timestamp", "UNIX_MS"]
114 target => "Timestamp"
118 # Filter for logback events
121 # mutate { add_field => { "orgmsg" => "%{message}" } } # Copy of orginal msg for debug
125 'message', ' = ', '=',
126 'message', '= ', '=null',
127 'message', '=\t', '=null ', #This null is followed by a tab
128 'message', '\t$', '\t'
132 break_on_match => false
134 "message" => ["%{TIMESTAMP_ISO8601:Timestamp}\t%{GREEDYDATA:Thread}\t%{SPACE}%{LOGLEVEL:loglevel}%{SPACE}\t%{JAVACLASS:Logger}\t(?:[^\t]+\t)*%{GREEDYDATA:message}",
137 "source" => ["/var/log/onap/(?<componentName>[^/]+)/",
138 "/var/log/onap/%{GREEDYDATA:componentLogFile}"
141 overwrite => ["message"]
148 remove_field => [ "MDCs" ]
152 match => [ "Timestamp", "ISO8601", "yyyy-MM-dd HH:mm:ss,SSS" ]
153 target => "Timestamp"
156 if [source] == "/var/log/onap/aai/aai-ml/metrics.log" {
161 columns => ["Begin TS", "End TS", "DuplicateRequestID", "Unknown1", "threadID", "phys/virt server name", "service name", "Partner Name", "Unknown2", "Unknown3", "Unknown4", "Unknown5", "Unknown6", "Unknown7", "Log level", "Unknown8", "Unknown9", "Status code", "Server", "Unknown10", "Unknown11", "Unknown12", "Unknown13", "Unknown14", "Unknown15", "Unknown16", "Unknown17", "Unknown18", "message"]
164 else if [source] == "/var/log/onap/aai/aai-ml/audit.log" {
169 columns => ["Begin TS", "End TS", "DuplicateRequestID", "Unknown1", "threadID", "phys/virt server name", "service name", "Partner Name", "Unknown2", "Unknown3", "Unknown4", "Unknown5", "Log level", "Unknown6", "Unknown7", "Status code", "Server", "Unknown10", "Unknown11", "Unknown12", "Unknown13", "Unknown14", "Unknown15", "Unknown16", "Unknown17", "message"]
174 remove_field => ["DuplicateRequestID", "Unknown1", "Unknown2", "Unknown3", "Unknown4", "Unknown5", "Unknown6", "Unknown7", "Unknown8", "Unknown9", "Unknown10", "Unknown11", "Unknown12", "Unknown13", "Unknown14", "Unknown15", "Unknown16", "Unknown17", "Unknown18"]
177 if ([source] == "/var/log/onap/sdc/sdc-be/audit.log") {
178 #Parse kvps in message
185 #If Request Id is missing and DID is present use as RequestId
186 if (![RequestId] and [DID] =~ /.+/) {
187 mutate { add_field => { "RequestId" => "%{DID}" } }
191 } #Close else statement for logback events
199 ######### Security configurations #########
202 password => "changeme"
204 ## The .cer or .pem file to validate the server's certificate
205 #cacert => $es_cacert
207 ## The keystore used to present a certificate to the server. It can be either .jks or .p12
208 #keystore => $es_keystore
209 #keystore_password => $es_keystore_password
211 ## Enable SSL/TLS secured communication to Elasticsearch cluster.
212 ## Default is not set which in that case depends on the protocol specidfied in hosts list
215 ## Option to validate the server's certificate. Default is true
216 #ssl_certificate_verification => $es_ssl_certificate_verification
218 ## The JKS truststore to validate the server's certificate.
219 #truststore => $es_truststore
220 #truststore_password => $es_truststore_password
223 ######### Elasticsearchcluster and host configurations #########
225 #can specify one or a list of hosts. If sniffing is set, one is enough and others will be auto-discovered
226 ##Also protocol can be specified like ["http://10.247.186.12:9200"]
227 hosts => ["http://elasticsearch.onap-log:9200"]
230 ## This setting asks Elasticsearch for the list of all cluster nodes and adds them to the hosts list. Default is false.
233 ## How long to wait, in seconds, between sniffing attempts. Default is 5 seconds.
236 ## Set the address of a forward HTTP proxy.
239 ##Use this if you must run Elasticsearch behind a proxy that remaps the root path for the Elasticsearch HTTP API lives
242 ######### Elasticsearch request configurations #########
244 ## This setting defines the maximum sized bulk request Logstash will make.
247 ######### Document configurations #########
249 index => "logstash-%{+YYYY.MM.dd}"
250 document_type => "logs"
252 ## This can be used to associate child documents with a parent using the parent ID.