Grouping
table. date
, process_id
, level
, and content
.
[2024-02-26 09:15:41 -0500] [671097] [ERROR] Shutting down: Master
We can extract the desired attributes with the below regex:
\[(?P<date>.+)\] \[(?P<process_id>.+)\] \[(?P<level>.*)\] (?P<content>.+)
Given the original log message and above regex, we receive the following key and value pairs:
level
, which accepts ERROR
, WARN
, INFO
, DEBUG
as valid values. Based on the level attribute, logs are available under specific severity levels. *****
, HIDDEN
, etc.Transaction ID: 675-98-3434
\\d{3}-?\\d{2}-?\\d{4}
modifies the log before sending: Transaction ID: *****