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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -