"Fossies" - the Fresh Open Source Software Archive

Member "monasca-log-api-2.9.0/devstack/files/monasca-log-persister/persister.conf" (1 Apr 2019, 1807 Bytes) of package /linux/misc/openstack/monasca-log-api-2.9.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. See also the latest Fossies "Diffs" side-by-side code changes report for "persister.conf": 2.7.0_vs_2.9.0.

    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         zk_connect => "127.0.0.1:2181"
   20         topic_id => "transformed-log"
   21         group_id => "logstash-persister"
   22     }
   23 }
   24 
   25 filter {
   26     date {
   27         match => ["[log][timestamp]", "UNIX"]
   28         target => "@timestamp"
   29     }
   30 
   31     date {
   32         match => ["creation_time", "UNIX"]
   33         target => "creation_time"
   34     }
   35 
   36     grok {
   37         match => {
   38             "[@timestamp]" => "^(?<index_date>\d{4}-\d{2}-\d{2})"
   39         }
   40     }
   41 
   42     if "dimensions" in [log] {
   43         ruby {
   44             code => "
   45                 fieldHash = event['log']['dimensions']
   46                 fieldHash.each do |key, value|
   47                     event[key] = value
   48                 end
   49             "
   50         }
   51     }
   52 
   53     mutate {
   54         add_field => {
   55             message => "%{[log][message]}"
   56             log_level => "%{[log][level]}"
   57             tenant => "%{[meta][tenantId]}"
   58             region => "%{[meta][region]}"
   59         }
   60         remove_field => ["@version", "host", "type", "tags" ,"_index_date", "meta", "log"]
   61     }
   62 }
   63 
   64 output {
   65     elasticsearch {
   66         index => "logs-%{tenant}-%{index_date}"
   67         document_type => "log"
   68         hosts => ["%ES_SERVICE_BIND_HOST%"]
   69         flush_size => 500
   70     }
   71 }