This is my s3 input config. I am trying to exclude a key that has name called CloudTrail-Digest.
input {
s3 {
type => "cloudtrail"
bucket => "aws"
prefix => "Accounts/"
add_field => { source => gzfiles }
backup_to_dir => "/mnt/aws/s3backup"
exclude_pattern => "^CloudTrail-Digest/"
codec => cloudtrail {}
region => "us-west-2"
sincedb_path => "/etc/s3backup/sincedb"
}
}
But when i try to run logstash. It still downloads that file. Any idea if my regex is wrong.
20:47:01.414 [[main]<s3] DEBUG logstash.inputs.s3 - S3 input: Adding to objects[] {:key=>"Accounts/bigdata/AWSLogs/xxxxxxxxxxx/CloudTrail-Digest/ap-northeast-2/2017/07/12/xxxxxxxxxxxx_CloudTrail-Digest_ap-northeast-2_CybersecurityTemplate-CloudTrailImpl-11EE2N5EAOL3B_us-west-2_20170712T090720Z.json.gz"}
20:47:01.414 [[main]<s3] DEBUG logstash.inputs.s3 - objects[] length is: {:length=>2999}