Created
February 18, 2021 00:24
-
-
Save muresan/c59f3ecfb803606d4ea8489f29f728a6 to your computer and use it in GitHub Desktop.
regexp log parsing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{job="varlogs",filename="/var/log/secure"} | |
| regexp "(?P<month>\\w+) (?P<day>\\d+) (?P<time>\\d{2}:\\d{2}:\\d{2}) (?P<hostname>\\w+) (?P<process>\\w+)\\[(?P<pid>\\d+)\\]: (?P<message>.*)" | |
{job="varlogs",filename="/var/log/messages"} | |
| regexp "(?P<month>\\w+) (?P<day>\\d+) (?P<time>\\d{2}:\\d{2}:\\d{2}) (?P<hostname>\\w+) (?P<process>\\w+)(\\[(?P<pid>\\d+)\\])?: (?P<message>.*)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment