hi all,
i've made a config file like this:
input {
file {
add_field => {"[@metadata][cl_cert]" => "cert.crt"}
add_field => {"[@metadata][cl_key]" => "private-key.pem"}
path => "/var/log/*.json"
start_position => "beginning"
}
}
filter {
.................
}
output {
http {
http_method => "post"
automatic_retries => 50
format => "json"
url => "https://xxx/xxx.php"
cacert => "/etc/ssl/certs/xxxx.pem"
client_cert => "/etc/logstash/%{[@metadata][cl_cert]}"
client_key => "/etc/logstash/%{[@metadata][cl_key]}"
}
But i obtain this error:
# This setting must be a path
# File does not exist or cannot be opened %{[@metadata][client_cert]}
client_cert => "%{[@metadata][cl_cert]}"
# This setting must be a path
# File does not exist or cannot be opened %{[@metadata][client_key]}
client_key => "%{[@metadata][cl_key]}"
The path is correct and the certificate can be used in the http output plugin if i change these lines
client_cert => "/etc/logstash/cert.crt"
client_key => "/etc/logstash/private-key.pem"
How can i avoid this problem?