I'm trying to run Logstash to send the output to Elasticsearch through a proxy. As far as I can tell there is no configuration for the output that would allow me to specify a proxy. Currently I use:
output {
elasticsearch {
protocol => "http"
host => "es-dev.local"
port => "9200"
index => "logstash-analysis-%{+YYYY.MM.dd}"
flush_size => "200"
workers => "2"
template_name => "logstash_per_index"
}
}
elasticsearch_http
also has no option for that. How can I use a proxy?
Things are quite simple once you know that in the end it's all just plain Java...
In other words Logstash uses Java's system properties to make this work. Then the only piece left is knowing how to specify it. Using environment variable
LS_JAVA_OPTS
does the trick:The downside of this approach is that there can only be one proxy for all outputs. It's not possible to use the proxy for just one output or use different proxies for different outputs.