Hi there,
I'm trying to ingest AWS WAF logs with logstash-8.9.0 and send them to my local ELK stack but am getting a 'Badly formatted index, after interpolation still contains placeholder' error. Here's my logstash config:
input {
s3 {
"access_key_id" => "foo"
"secret_access_key" => "bar"
"region" => "us-east-1"
"bucket" => "aws-waf-logs"
"type" => "waf-log"
"interval" => "300"
"sincedb_path" => "/tmp/.waf-log_since.db"
}
}
filter {
if [type] == "waf-log" {
json {
source => "message"
}
date {
match => [ "[timestamp]", "UNIX_MS" ]
}
geoip {
source => [ "[httpRequest][clientIp]" ]
target => geoip
}
ruby {
code => '
event.get("[httpRequest][headers]").each { |kv|
event.set(name = kv["name"], value = kv["value"])}
'
}
}
}
output {
elasticsearch {
hosts => ["http://127.0.0.1:9200/"]
index => "%{[type]}%-{+YYYY.MM.dd}"
ilm_enabled => false
data_stream => false
action => "create"
}
}
I read Could not index event to Elasticsearch DataStream but changing index to 'index => "%{[@metadata][beat]}-%{[@metadata][version]}"' returns the same 'Badly formatted index' error.
Can anyone point me in the right direction?
Thanks!