"Fossies" - the Fresh Open Source Software Archive

Member "monasca-api-4.0.0/devstack/files/monasca-log-persister/persister.conf" (13 May 2020, 1851 Bytes) of package /linux/misc/openstack/monasca-api-4.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Generic config files source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #
    2 # Copyright 2016 FUJITSU LIMITED
    3 #
    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
    7 #
    8 #    http://www.apache.org/licenses/LICENSE-2.0
    9 #
   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
   13 # implied.
   14 # See the License for the specific language governing permissions and
   15 # limitations under the License.
   16 #
   17 input {
   18     kafka {
   19         bootstrap_servers => "%KAFKA_SERVICE_HOST%:%KAFKA_SERVICE_PORT%"
   20         codec => json
   21         topics => ["transformed-log"]
   22         group_id => "logstash-persister"
   23     }
   24 }
   25 
   26 filter {
   27     date {
   28         match => ["[log][timestamp]", "UNIX"]
   29         target => "@timestamp"
   30     }
   31 
   32     date {
   33         match => ["creation_time", "UNIX"]
   34         target => "creation_time"
   35     }
   36 
   37     grok {
   38         match => {
   39             "[@timestamp]" => "^(?<index_date>\d{4}-\d{2}-\d{2})"
   40         }
   41     }
   42 
   43     if "dimensions" in [log] {
   44         ruby {
   45             code => "
   46                 fieldHash = event.get('[log][dimensions]')
   47                 fieldHash.each do |key, value|
   48                     event.set(key,value)
   49                 end
   50             "
   51         }
   52     }
   53 
   54     mutate {
   55         add_field => {
   56             "message" => "%{[log][message]}"
   57             "log_level" => "%{[log][level]}"
   58             "tenant" => "%{[meta][tenantId]}"
   59             "region" => "%{[meta][region]}"
   60         }
   61         remove_field => ["@version", "host", "type", "tags" ,"_index_date", "meta", "log"]
   62     }
   63 }
   64 
   65 output {
   66     elasticsearch {
   67         index => "logs-%{tenant}-%{index_date}"
   68         document_type => "log"
   69         hosts => ["%ES_SERVICE_BIND_HOST%"]
   70     }
   71 }