For Winlogbeat there is a file in c:\ProgramData\Winlogbeat.winlogbeat.yml that shows you the last record sent to Elasticsearch from the machine. I noticed that if you delete this file it will not resend the events to ES and instead will recreate the file with the last record sent. I assume there is also record keeping in Elasticsearch but I can't find where it is located. If i delete the entire index and the .winlogbeat.yml the event log data will resend , but without deleting the index it will not resend.
Did you stop Winlogbeat before deleting the file? No state is stored in ES. That file holds all of the state that Winlogbeat will use to resume during a restart.
I did and double checked to make sure the service was in a stopped state before removing the file. When it started the file back up it was right back where it left off before deletion.
I am pulling the entire security log filtering on event_id: 4624
winlogbeat.event_logs:
name: Application
ignore_older: 72h
name: Security
event_id: 4624
name: System
After some more testing i noticed a few things -
Stopped the Service -> Deleted the .winlogbeat.yml -> Started the Service
The File was recreated at the same record count before being deleted but it is re-sending the Event logs to ES which led the confusion. On another machine the record count would reset when the file was deleted and increase as the logs were being sent to ES... Not sure why in this case it goes straight to the last record even though it hasn't been sent yet.
It's going to be very hard to observe the starting state by looking at this file because it is updated so quickly after Winlogbeat is started. If you want to confirm the first record_number then I recommend enabling the file output and looking at the first event that gets written.
Stop Winlogbeat
Enable the file output in your config.
Delete the registry file (aka .winlogbeat.yml).
Delete any previously created output files.
Start Winlogbeat.
Observe the record_number of the first event written to the file output. (Note that these output files automatically rotate so the first record will be at the beginning of the oldest file.)
The record_number in the registry file is updated after the event has been confirmed to have been received by the output. So when Elasticsearch responds with a 200 OK to Winlogbeat's _bulk indexing request then Winlogbeat will eventually persist this number. This is how Winlogbeat achieves its at-least-once delivery semantics.
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.