it send the o/p to Elastisearch but WHEN I ADD NEW FILE AGAIN IN /var/log/apache/ folder which i mentioned in filebeat.yml ,it resend the already sent data again to those index so how to stop that file to send its data again if its already sent
Include ignore_older property in your filebeat.yml config. For eg if you have mention ignore_older: 5s then filebeat wont pickup the file if the file is not modified for past 5s.
Not sure I understand how you are adding a new file. If the original file is just renamed, Filebeat should normally notice that and not send the file again. Can you give more details about the rotation strategy?
So you simply add a new file and the contents of the other files are sent again? That sounds quite strange. Can you come up with step by step instructions on how to reproduce it?
If you see my filebeat.yml file above, there i mentioned /var/log/apaches/*.log.
Let suppose initially under that folder there is no file and i started my filebeat and logstash command..
when i add new file let suppose 'apache.log' under /var/log/apaches/ it matches with my filebeat.yml condition so it send data to ES.
If again i create a new file 'test.log' under same fodler then it matche with /var/log/apache and send both earlier file (apache.log) and test.log to ES .
Include ignore_older property like below in your config file and mention the time in sec. For eg below I have mentioned 10s. So filebeat will read the file and wait for 10s and it will started to read the next file if there is nor modification in that file. It wont read again that file. Please refer the below link for detail description.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.