I'm trying to extract (or) export logs from Elasticsearch via Logstash
I would like to write the extracted logs to a file
input {
elasticsearch {
hosts => "elasticsearch.domain.com:9200"
query => '{ "size": 5, "query": { "match": { "host.ip": "10.1.1.1"} } }'
size => 5
user => "<username>"
password => "<password>"
scroll => "1m"
ca_file => "/etc/logstash/certs/ca.crt"
ssl => true
index => "winlogbeat-7.10*"
}
}
output {
file {
path => "/var/log/logstash/search-output.txt"
codec => line
}
}
