I can't get ILM rollover alias to accept variables. In this particular instance, we'll have an ELK cluster hosting logs for multiple environments. The log entries will be stamped with their environment before coming into the logstash pipeline. I'd like the entries to go to the correct alias, but I get the following error when starting logstash (truncated the stacktrace):
An unexpected error occurred! {:error=>java.net.URISyntaxException: Malformed escape pair at index 0: %{[fields][Environment]}-logs
Here is my logstash pipeline:
input {
rabbitmq {
host => "rabbitmq"
port => 5672
user => "guest"
password => "guest"
subscription_retry_interval_seconds => 5
queue => "logstash-queue"
exchange => "logs"
exchange_type => "direct"
durable => true
key => "logstash"
}
}
filter {
mutate {
rename => {"Properties" => "fields"}
}
mutate {
lowercase => ["[fields][Environment]"]
}
}
output {
elasticsearch {
hosts => ["http://elasticsearch:9200"]
template_name=>"app-logs"
ilm_enabled => true
ilm_rollover_alias => "%{[fields][Environment]}-logs"
ilm_pattern => "{now/d}-000001"
ilm_policy => "30_day_retention_logs_policy"
}
}