Quantcast
Channel: FluentD, how to grep only spcific logs - Stack Overflow
Viewing all articles
Browse latest Browse all 2

FluentD, how to grep only spcific logs

$
0
0
2019/08/13 13:13:17 [DEBUG] Hello, world!
2019/08/13 13:13:17 [INFO] Ignore me
2019/08/13 13:13:17 [INFO] SPECIFIC_LOG :{"name": "mark"}

I have like above logs, and I need to grep only the logs which contains 'SPECIFIC_LOG' and I want to ignore the others.

I tried to set the config like this,

<source>
    @type tail
    path ./sample.log
    tag debug.sample
    <parse>
        @type regexp
        expression /\[\w+\] SPECIFIC_LOG\s:(?<message>.*)$/
    </parse>
</source>

<filter debug.**>
    @type parser
    key_name message
    format json
</filter>

And it is working for the matched log with pattern, but for the not matched log, I got warning which says

#0 pattern not matched: "2019/08/13 13:13:17 [DEBUG] Hello, world!"

How can I grep only the log which is matched the pattern, so that I can resolve the warning?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images