Updated at: 2022-12-09 03:49:50
Click Data Source > Agent > Template Configuration > +New to make the New Template. Select Filebeat in the Agent Type, and the specific configuration parameters are as follows: 
• Filebeat Input Template:
File Name Field Description
File Path The specified file path for aggregation, such as, 
• /var/log/Apache.txt means to aggregate the specified Apache file;
• /var/log/* means to aggregate all log files in the log folder.
Code The code format of the file, as plain by default
Filter Historical Files • Enabled: To configure Filter Range of time, filter historical log files according to the Filter Range;
• Disabled: The historical log files will be aggregated.
Note: Editing is allowed only when creating a new one, and not allowed after creation.
Excluded Line If the log data matches the expression of Excluded Line, the line will be excluded.
Preserved Line Only log data matching Reversal Expression will be aggregated.
Filter Historical Logs • Enabled: The historical data will not be aggregated, and only incremental data will be aggregated;
• Disabled: The full data will be aggregated.
Merge Multi-lines ► Enabled: For configuring multi-lines merge rule to perform multi-lines merge for matched data: 
• Multi-lines Merged: If the current line matches the Regular Expression, it will be merged into one line;
• Regular Reversal Expression: If enabled, it means that if the current line does not match the Regular Expression, it will be merged into one line;
• Match Mode: Select the After to merge with the front content, or the Before to merge with the latter content.
► Disabled: The multi-lines will not be merged.
Added Field It is to add custom fields to log data.
• Filebeat Output Template:
File Name Field Description
Output Type The Output Type is Logstash.
Output Address The specified transfer destination of log data
Output Port The specified transfer port of log data