logging - Delete logs after consumption: logstash -
i have logstash watching directory on host. every time sees log matches path specified in logstash config starts import data elasticsearch cluster. logstash have way delete log after done consuming it?
i want write script delete logs logstash done how should know logs done ?
maybe u guys done before or have idea how implement this?
logstash not able delete files. focus of file input plugin continuously monitor files there's no way of knowing when file done, i.e. when no more writes take place.
if know when files "done" invoke logstash , feed files via stdin input plugin. logstash terminate upon receiving end-of-file , script delete file.
you read sincedb files , compare logstash's current file offset size of corresponding file. see understanding sincedb files logstash file input details on format of sincedb files.
or make sure have enough disk space , use regular log rotation delete files based on e.g. age. disk space cheaper time.
Comments
Post a Comment