| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| input { |
| http { |
| codec => "json" |
| port => 8888 |
| response_headers => { |
| "Access-Control-Allow-Origin" => "*" |
| "Access-Control-Allow-Headers" => "Origin, X-Requested-With, Content-Type, Accept" |
| } |
| } |
| |
| file { |
| path => [ |
| "/var/log/sennsoft/*.log" |
| ] |
| codec => "json" |
| start_position => "beginning" |
| sincedb_path => "/dev/null" |
| } |
| } |
| |
| ## Add your filters / logstash plugins configuration here |
| filter { |
| mutate { |
| remove_field => [ "message", "@version", "@timestamp"] |
| } |
| |
| grok { |
| match => [ "useraleVersion", "(?<major_ver>\d+).(?<minor_ver>\d+)(.(?<patch_ver>\d+))?" ] |
| match => [ "toolVersion", "(?<tool_major_ver>\d+).(?<tool_minor_ver>\d+)(.(?<tool_patch_ver>\d+))?" ] |
| } |
| |
| #dns { |
| # add_field => [ "hostname", "%{host}" ] |
| #} |
| |
| #dns { |
| # resolve => [ "host" ] |
| # action => [ "replace" ] |
| #} |
| |
| #geoip { |
| # source => "host" |
| # database => "/usr/share/GeoIP/GeoIP.dat" |
| # target => "geoip" |
| #} |
| } |
| |
| output { |
| # Output data to Elasticsearch instance |
| elasticsearch { |
| hosts => "elasticsearch:9200" |
| action => "index" |
| index => "userale" |
| document_type => "logs" |
| manage_template => true |
| template_overwrite => true |
| template => "/etc/logstash/conf.d/userale.json" |
| template_name => "userale" |
| } |
| |
| # Debug |
| stdout { codec => rubydebug } |
| } |