A
A
Aleksandr Yurchenko2021-09-29 22:28:08
Regular Expressions
Aleksandr Yurchenko, 2021-09-29 22:28:08

How to make a regular routine for "highlighting" logs?

Hello.

Help compose a regular routine for highlighting logs. Log format:

[2021-09-29T01:15:06.864049+03:00] security.DEBUG: The "App\Security\Admin\Authenticator" authenticator set the failure response. {"authenticator":"App\\Security\\Admin\\Authenticator"} []
[2021-09-29T01:15:06.864234+03:00] security.INFO: Clearing remember-me cookie. {"name":"REMEMBERME"} []


In a regular expression, you need to limit the search by strings, that is, ^...$. According to the idea you need to get
.*\.DEBUG
.*\.INFO
.*\.WARNING
.*\.ERROR

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aleksandr Yurchenko, 2021-09-29
@yaleksandr89

It turned out this regularity:

^.*\.DEBUG.*$
^.*\.INFO.*$
^.*\.WARNING.*$
^.*\.ERROR.*$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question