Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support continue/end multiple regex patterns #978

Merged
merged 13 commits into from
Aug 24, 2023

Conversation

Abingcbc
Copy link
Collaborator

@Abingcbc Abingcbc commented Jul 5, 2023

配置文件

enable: true
inputs:
  - Type: file_log
    LogPath: .
    FilePattern: simple.log
processors:
  - Type: processor_regex_accelerate
    Keys:
    - msg
    - time
    Regex: (\[(\S+)].*)
    DiscardUnmatch: false
    LogBeginRegex: \[\d+-\d+-\w+:\d+:\d+.\d+].*Exception.*
    LogEndRegex: .*\.\.\..*
flushers:
  - Type: flusher_sls
    Endpoint: 
    ProjectName:
    LogstoreName:

样例日志

[2022-07-07T10:43:27.360266763] [ERROR] java.lang.Exception: exception happened
[2022-07-07T10:43:27.360266763]    at com.aliyun.sls.devops.logGenerator.type.RegexMultiLog.f2(RegexMultiLog.java:108)
[2022-07-07T10:43:27.360266763]    at java.base/java.lang.Thread.run(Thread.java:833)
[2022-07-07T10:43:27.360266763]    ... 23 more
[2022-07-07T10:43:27.360266763] Some user custom log
[2022-07-07T10:43:27.360266763] Some user custom log
[2022-07-07T10:43:27.360266763] Some user custom log
[2022-07-07T10:43:27.360266763] Some user custom log
[2022-07-07T10:43:27.360266763] [ERROR] java.lang.Exception: exception happened
[2022-07-07T10:43:27.360266763]    at com.aliyun.sls.devops.logGenerator.type.RegexMultiLog.f2(RegexMultiLog.java:108)
[2022-07-07T10:43:27.360266763]    at java.base/java.lang.Thread.run(Thread.java:833)
[2022-07-07T10:43:27.360266763]    ... 23 more
[2022-07-07T10:43:27.360266763] Some user custom log
[2022-07-07T10:43:27.360266763] Some user custom log

结果

多行
image

单行
image

core/config/Config.cpp Outdated Show resolved Hide resolved
core/config_manager/ConfigYamlToJson.cpp Show resolved Hide resolved
core/reader/LogFileReader.h Outdated Show resolved Hide resolved
@Abingcbc Abingcbc marked this pull request as draft July 10, 2023 01:57
@Abingcbc Abingcbc changed the title feat: support multiple regex pattern in LastMatchedLine WIP: feat: support multiple regex patterns Jul 10, 2023
@Abingcbc Abingcbc force-pushed the improve-multiline branch 3 times, most recently from 45ad3e8 to ad46fb4 Compare July 12, 2023 08:59
@Abingcbc Abingcbc marked this pull request as ready for review July 12, 2023 08:59
@Abingcbc Abingcbc changed the title WIP: feat: support multiple regex patterns feat: support multiple regex patterns Jul 12, 2023
@Abingcbc Abingcbc force-pushed the improve-multiline branch from 36d5474 to 62e525c Compare July 14, 2023 09:31
core/config/Config.cpp Outdated Show resolved Hide resolved
docs/cn/data-pipeline/accelerator/regex-accelerate.md Outdated Show resolved Hide resolved
core/reader/LogFileReader.h Outdated Show resolved Hide resolved
core/reader/LogFileReader.cpp Outdated Show resolved Hide resolved
core/reader/LogFileReader.cpp Outdated Show resolved Hide resolved
docs/cn/data-pipeline/accelerator/regex-accelerate.md Outdated Show resolved Hide resolved
docs/cn/data-pipeline/accelerator/regex-accelerate.md Outdated Show resolved Hide resolved
core/reader/LogFileReader.cpp Outdated Show resolved Hide resolved
core/reader/LogFileReader.cpp Show resolved Hide resolved
core/reader/LogFileReader.cpp Show resolved Hide resolved
core/reader/LogFileReader.cpp Show resolved Hide resolved
core/reader/LogFileReader.h Outdated Show resolved Hide resolved
core/reader/LogFileReader.h Outdated Show resolved Hide resolved
core/unittest/config/ConfigMatchUnittest.cpp Outdated Show resolved Hide resolved
core/reader/LogFileReader.cpp Outdated Show resolved Hide resolved
core/unittest/reader/LastMatchedLineUnittest.cpp Outdated Show resolved Hide resolved
core/unittest/reader/LastMatchedLineUnittest.cpp Outdated Show resolved Hide resolved
core/unittest/reader/LastMatchedLineUnittest.cpp Outdated Show resolved Hide resolved
@Abingcbc Abingcbc force-pushed the improve-multiline branch 2 times, most recently from 94ff7b0 to 987314f Compare August 10, 2023 08:26
@yyuuttaaoo yyuuttaaoo changed the title feat: support multiple regex patterns feat: support continue/end multiple regex patterns Aug 24, 2023
@yyuuttaaoo yyuuttaaoo merged commit e6f0be8 into alibaba:feature/memory_model Aug 24, 2023
yyuuttaaoo added a commit that referenced this pull request Aug 25, 2023
* close #886, refactory LogBuffer structure

refine memory management
support \0 in log

* add unittest

* close #886, refactory LogBuffer structure

refine memory management
support \0 in log

* add unittest

* close #886, refactory LogBuffer structure  (#930)

* close #886, refactory LogBuffer structure

refine memory management
support \0 in log

* add unittest

* close #886, refactory LogBuffer structure

refine memory management
support \0 in log

* add unittest

* test: complement test cases for reader and parser (#946)

* fix unittest timezone

* reader unit test

* fix: multi-bytes character cut off (#968)

* fix: multi-bytes character cut off

* support GB 18030

* [WIP] C++ pipeline stage1: processors

new model and partial processors without unittests

* do not commit personalized settings

* remove unused fields in data structure

* fix compile error

* C++ pipeline stage1: processors (#995)

* remove useless codes

* add UT

* Remove the limit that accelerate plugins cannot be used with other plugins

* fix accelerate plugin with only go flusher plugin

* fix UT

* fix member uninitialized

* fix pass to Go plugin tag name error

* fix c++ to go process

* fix process buffer legacy

* refine code according to comments

* stick to container naming convention, stick to smart pointer param passing convention

* fix split line if not enable_new_pipeline

* accelerate FileSystemUtilUnittest speed

Signed-off-by: Tao Yu <yyuuttaaoo@gmail.com>

* fix multiline config when using new pipeline (#1079)

* fix multiline config when using new pipeline

* refine doc

* fix pure plugin multiline does not split correctly

---------

Signed-off-by: Tao Yu <yyuuttaaoo@gmail.com>

* feat: support continue/end multiple regex patterns (#978)

* feat: support  continue/end multiple regex patterns

* fix unittest

* doc

---------

Co-authored-by: Tom Yu <yyuuttaaoo@gmail.com>

* feat: read timeout (#1067)

* feat: read log timeout

* fix ci with longer timeout

* remove profiler in CMakeLists.txt

Signed-off-by: yyuuttaaoo <yyuuttaaoo@gmail.com>

* add changelog

---------

Signed-off-by: Tao Yu <yyuuttaaoo@gmail.com>
Signed-off-by: yyuuttaaoo <yyuuttaaoo@gmail.com>
Co-authored-by: Bingchang Chen <abingcbc626@gmail.com>
@yyuuttaaoo yyuuttaaoo added this to the v1.8 milestone Sep 26, 2023
@yyuuttaaoo yyuuttaaoo added the feature New feature label Sep 26, 2023
@Abingcbc Abingcbc deleted the improve-multiline branch November 27, 2024 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants