简体   繁体   中英

Scheduling logstash

I am using Elasticsearch with Logstash. I am currently ingesting a CSV file and I want it to run by schedule. Is there a configuration for it like the "schedule" config when ingesting SQL that I could use with the same function?

schedule => "* * * * *"

If you use the file input in Logstash, there is an option called stat_interval ( link ) which specifies how often in seconds the file is checked to see if it has been modified. Is there any reason you need it to run it at specific times? If not, you could use something like...

input {
   file {
     path => [ "/tmp/your-file" ]
     stat_interval => 60
   }
}
filter {
   csv { }
}

This would check your file for changes every 60 seconds and parse the csv into key/value pairs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM