Hello,
I have my last line of csv data that I get with http_poller plugin that is not imported. Some people have solved the problem by adding a blank newline at the end of the csv file. But me in my case my file is recovered directly through an http_poller so I tried to add a new line with ruby code but it did not work and I'm looking for that normal because I read in codec line . and I tried in multiline but it does not work to parser the file in csv. So How to fix this problem??
here is my code below:
input {
#Import all data
http_poller {
urls => {
data => "https://site/index.php?format=CSV"
}
request_timeout => 60
socket_timeout => 30
# Supports "cron", "every", "at" and "in" schedules by rufus scheduler
schedule => { cron => "49 16 * * * Europe/Paris"}
codec => line { charset => "UTF-16" }
proxy => "http://xxxx
}
}
filter {
mutate {gsub => [ "message", "[^\d]$", ""] }
ruby {code => "event.set('message', event.get('message') + ' ' + 10.chr)"}
csv {
skip_header => true
separator => ","
autodetect_column_names => true
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "piwik-%{+YYYY.MM.dd}"
}
Thank you for your help !