Hi Team,
Great morning, Hope you are doing awesome.
I am trying to ship cloudtrail logs in my ELK. But I'm getting following warning
[WARN ] 2018-11-14 23:45:37.775 [Ruby-0-Thread-6@[main]>worker0: :1] elasticsearch - Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"cloudtrail-2018.11.15", :_type=>"doc", :_routing=>nil}, #LogStash::Event:0x52da2cb2], :response=>{"index"=>{"_index"=>"cloudtrail-2018.11.15", "_type"=>"doc", "_id"=>"LrWwFWcBV6thQHuuWGBp", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse [Records.apiVersion]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Invalid format: "2017_10_30" is malformed at "_10_30""}}}}}
Though logs are shipping in my kibana. but I saw a warning message on kibana UI: "Objects in arrays are not well supported"
My config file is as below :
input {
s3 {
bucket => "abc"
prefix => "abcded/"
region => "us-east-1"
type => "cloudtrail"
codec => json_lines
secret_access_key => "asdafafafas"
access_key_id => "asdfsafsfsd"
}
}
filter {
if [type] == "cloudtrail" {
geoip {
source => "sourceIPAddress"
target => "geoip"
add_tag => [ "cloudtrail-geoip" ]
}
}
mutate {
add_field => { "indexname" => "cloudtrail-%{+YYYY.MM.dd}" }
}
mutate {
lowercase => [ "indexname" ]
}
mutate {
gsub => [
"eventSource", "\.amazonaws\.com$", "",
"apiVersion", "_", "-"
]
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "cloudtrail-%{+YYYY.MM.dd}"
}
}
Note : logstash.version"=>"6.3.1
elasticsearch version 6.3.2