Hi all,
I'm using LS2.1.1 with ES2.1.1, in AWS, to log various sources within my environment.
One of these sources is AWS CloudTrail.
I've noticed a strange problem when trying to optimise my elasticsearch cluster, by reducing the indices and shards, more details here.
So I've optimised my cluster by reducing both my total indices and total shards. Good news so far.
My input used for logstash-input-s3:
input { s3 { bucket => "my-logs-cloudtrail" delete => false interval => 60 # seconds prefix => "AWSLogs/MYACCOUNTID/CloudTrail/" type => "cloudtrail" codec => "cloudtrail" credentials => "/etc/logstash/s3_credentials.ini" sincedb_path => "/opt/logstash_cloudtrail/MYACCOUNTID-sincedb" } }
My filter used to parse the incoming logs:
filter { if [userIdentity][accountId] =~ "MYACCOUNTID" { mutate { add_field => [ "accountName", "mylogs-aws-development" ] } } }
My output used to send to Elasticsearch:
output { if [type] == "cloudtrail" { elasticsearch { hosts => "MYESCLUSTER" index => "logstash-cloudtrail" } } else { elasticsearch { hosts => "MYESCLUSTER" index => "wtf-are-these-logs" } } stdout { codec => "rubydebug" } }
I noticed that my filter is working as, as it was before, however, something odd started to happen:
-Document count continues to grow at nearly the same rate.
-I restarted the cluster logging a few times.
-I triple checked my input, filter, and output.
Then I started to compare events from each index, and noticed:
-Sample events were identical.
-Events in wtf-are-these-logs
index are also labelled type: cloudtrail
-The frequency of events, displayed using kibana, is almost identical.
I cant explain this.
Has anyone else seen this before?
Can anyone assist with an explanation or how I can stop this?