- Documentation
Torch Log Service
User Guide
Data collection
LogCollector collection
LogCollector plugins
Field splitting and reassembly plugin
LogCollector plugins
Field splitting and reassembly plugin
Field splitting and reassembly plugin
You can use LogCollector's split_select plugin to split the value of a specified field by your chosen separator, select elements by index, and combine them into a new field to add to your log.
- Separator: used to split the original field and assemble selected elements.
- Index: used to select elements after splitting a field. The starting index starts from 0 and is a closed interval.
Notice
This plugin is supported in LogCollector V2.2.5 and later versions. To view LogCollector version, see 2. View software version. split_select plugin parameter description
Index parameter instructions:
Example of selecting elements in the middle of a field
"path_info": "/usr/local/bin/app"
- Processor configuration of LogCollector split_select plugin
- Keep the original field path_info value; split by the separator /; select the elements at index positions [1,2]; and save them to the selected_path field.
"new_field": "selected_path",
Notice
The index position starts before the specified separator "/".
"path_info": "/usr/local/bin/app",
"selected_path": "usr/local"
Example of selecting field elements from the specified position to the end
- The key-value log is as follows:
"tags": "apple,banana,orange,grape"
- The split_select plugin processor configuration for LogCollector is as follows:
- Keep no original field tags value; split by the separator ,; select elements from index 2 to the end after splitting; and save them to the last_two_fruits field.
"new_field": "last_two_fruits",
"last_two_fruits": "orange,grape"
Example of selecting the first element of a field
- The key-value log is as follows:
"file_name": "report.final.docx",
- The split_select plugin processor configuration for LogCollector is as follows:
- Keep the original file_name field value; split it by the separator; select the first element after splitting; and save it to the base_name field.
"new_field": "base_name",
"file_name": "report.final.docx",
Last updated: 2025.12.12 14:07:35