Thanks Dave.
Hi Christian,
The Logstash config is as below. Yes, both Filebeat instances are going into the same pipeline.
input {
beats {
port => 5400
}
}
filter {
grok {
match => { 'message' => '%{IPORHOST:clientip} - - \[%{HTTPDATE:timestamp}\] \"(?:%{WORD:verb} %{URIPATHPARAM:request}(?: HTTP/%{NUMBER:httpversion})?|)\" %{NUMBER:answer} (?:%{NUMBER:byte}|-) (?:\"(?:%{URI:referrer}|-))\" %{QS:agent} "%{IPORHOST:proxyip}" "%{IPORHOST:hostname}" "%{GREEDYDATA:ident}"'}
}
mutate {
convert => ["bytes", "integer"]
}
geoip {
source => "clientip"
target => "geoip"
add_tag => [ "nginx-geoip" ]
}
date {
match => [ "timestamp" , "dd/MMM/YYYY:HH:mm:ss Z" ]
remove_field => [ "timestamp" ]
}
useragent {
source => "agent"
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "weblog-%{+YYYY.MM.dd}"
document_type => "nginx_logs"
}
stdout { codec => rubydebug }
}
Below are snippets of the DEBUG logs in the Logstash via zgrep:
/var/log/logstash.own/logstash-plain-2017-12-28.log.gz:[2017-12-28T06:31:58,258][DEBUG][logstash.pipeline ] output received {"event"=>{"request"=>"/app/profile/edit.do?task=doShareChartData", "agent"=>""Mozilla/5.0 (Linux; Android 6.0.1; OPPO R9s Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/46.0.2490.76 Mobile Safari/537.36"", "proxyip"=>"108.xxx.xxx.227", "minor"=>"0", "ident"=>"xxxxx777", "os_minor"=>"0", "os_major"=>"6", "source"=>"/home/nginxlogs/nginx-access.log", "type"=>"log", "patch"=>"2490", "hostname"=>"www.xxxx.com", "major"=>"46", "clientip"=>"116.xxx.xxx.86", "@version"=>"1", "beat"=>{"name"=>"fb2.xxx.xxx.com", "hostname"=>"fb2.xxx.xxx.com", "version"=>"5.6.3"}, "host"=>"fb2.xxx.xxx.com", "geoip"=>{"city_name"=>"xxx", "timezone"=>"xxx", "ip"=>"xxx", "latitude"=>xxx, "country_name"=>"xxx", "country_code2"=>"xx", "continent_code"=>"xx", "country_code3"=>"xx", "region_name"=>"xxxx", "location"=>{"lon"=>xxx, "lat"=>xxx}, ......}}
(Apologies, i had to "mask" certain values).
Thanks for helping out. However, I can't see how the issue is on the Logstash, as I'm able to see the logs which are coming in from Filebeat in IP_B. I have different name and hostname on the beat.name and beat.hostname elements.