whether to add the default log collection state meta information
event example
{"body":"this is test","state":{"pipeline":"local","source":"demo","filename":"/var/log/a.log","timestamp":"2006-01-02T15:04:05.000Z","offset":1024,"bytes":4096,"hostname":"node-1"}}
state explanation:
pipeline: the name of the pipeline where it is located
source: the name of the source where it is located
filename: the name of the collected file
timestamp: the timestamp of the collection time
offset: the offset of the collected data in the file
bytes: the number of bytes of data collected
hostname: the name of the node where it is located
The number of worker threads (goroutines) that read the contents of the file. Consider increasing it when there are more than 100 files on a single node
The number of times the content of the same file is read continuously. Reaching this number of times cause forced switch to the next file to read. The main function is to prevent active files from occupying reading resources all the time, in which case inactive files cannot be read and collected for a long time.
If the file has exceeded inactiveTimeout from the last collection, it is considered that the file has entered an inactive state (that is, the last log has been written), and that the last line of log can be collected safely.
Use the first n characters of the collected target file to generate the file unique code. If the size of the file is less than n, the file will not be collected temporarily. The main purpose is to accurately identify a file in combination with file inode information and to determine whether the file is deleted or renamed.
A regular expression that is used to judge whether a line is a brand new log. For example, if it is configured as '^[', it is considered that a line beginning with [ is a new log, otherwise the content of this line is merged into the previous log as part of the previous log.
Number of lines a log can contains at most. The default is 500 lines. If the upper limit is exceeded, the current log will be forced to be sent, and the excess will be used as a new log.
Number of bytes a log can contains at most. The default is 128K. If the upper limit is exceeded, the current log will be forced to be sent, and the excess will be used as a new log.
How long to wait for a log to be collected as a complete log. The default is 5s. If the upper limit is exceeded, the current log will be sent, and the excess will be used as a new log.
Configuration related to the confirmation of the source. If you need to make sure at least once, you need to turn on the ack mechanism, but there will be a certain performance loss.
Caution
This configuration can only be configured in defaults
Use sqlite3 as database. Save the file name, file inode, offset of file collection and other information during the collection process. Used to restore the last collection progress after logie reload or restart.
Caution
This configuration can only be configured in defaults.
When the time from the last collection of the file to the present exceeds the limit (the file has not been written for a long time, it is considered that there is a high probability that the content will not be written again), the handle of the file will be released to release system resources
When the file is deleted and the collection is not completed, it will wait for the maximum time to complete the collection. If the limit is exceeded, no matter whether the file is finally collected or not, the handle will be released directly and no longer collected.
The maximum number of times EoF is encountered in consecutive reads of a file. If the limit is exceeded, it is considered that the file is temporarily inactive and will enter the "zombie" queue to wait for the update event to be activated.
Whether to start collecting from the latest line of the file, regardless of writing history. It is suitable for scenarios such as migration of collection systems.
Maximum number of days to keep files (after collection). If the limit is exceeded, the file will be deleted directly from the disk. If not configured, the file will never be deleted