多行切分
Last updated
echo -e '[2022-03-03 18:00:00] xxx1\nyyyyy\nzzzzzz\n[2022-03-03 18:00:01] xxx2\nyyyyy\nzzzzzz' >> /home/test-log/multiline.logenable: true
inputs:
- Type: input_file
FilePaths:
- /home/test-log/*.log
processors:
- Type: processor_split_log_regex
SplitRegex: \[\d+-\d+-\d+\s\d+:\d+:\d+]\s.*
SplitKey: content
PreserveOthers: true
flushers:
- Type: flusher_stdout
OnlyStdout: true{
"__tag__:__path__": "/home/test-log/multiline.log",
"content": "[2022-03-03 18:00:00] xxx1\nyyyyy\nzzzzzz\n",
"__time__": "1657367638"
}
{
"__tag__:__path__": "/home/test-log/multiline.log",
"content": "[2022-03-03 18:00:01] xxx2\nyyyyy\nzzzzzz",
"__time__": "1657367638"
}