Skip to content

Commit

Permalink
add alternative pattern for I2P log pattern
Browse files Browse the repository at this point in the history
for matching the startup lines, for formati recognition
  • Loading branch information
mpeter50 committed Jul 22, 2024
1 parent 514b27f commit ce88dce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/formats/i2p_router_log.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
"multiline": true,
"regex": {
"std": {
"pattern": "^(?J:(?:(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:(?<level>[A-Z]+) \\[(?<module>[\\w \\/]+)\\] (?<component>[\\w.]+): (?<body>.*)|(?:(?:\\^){3} \\d+ similar messages omitted (?:\\^){3})))|(?:(?:(?:[\\w.]+(?<level>Exception):)|(?:\\\\u0009at)) .*))$"
"pattern": "^(?J:(?:(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:(?<level>[A-Z]+) \\[(?<module>[\\w \\/]+)\\] (?<component>[\\w.]+): (?<body>.*)|(?:(?:\\^){3} \\d+ similar messages omitted (?:\\^){3})))|(?:(?:(?:[\\w.]+(?<level>Exception):)|(?:\\\tat)) .*)|(?:(?:\\*{3} .*)|(?:Starting I2P.*)|(?:\\[startapp].*)))$"
// The I2P router uses several log line variants that largely differ in their formats.
// Editing a variant should be done below in subformats for better readability and understandability,
// and then merged into the pattern above.
// subformats:
// "variant_normal": "^(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?<level>[A-Z]+) \\[(?<module>[\\w \\\/]+)\\] (?<component>[\\w.]+): (?<body>.*)$"
// "variant_omit": "^(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:\\^){3} \\d+ similar messages omitted (?:\\^){3}$"
// "variant_exception": "^(?:(?:(?:[\\w.]+(?<level>Exception):)|(?:\\\\0009at)) .*)$"
// "variant_startup_lines": "^(?:(?:\*{3} .*)|(?:Starting I2P.*)|(?:\[startapp].*))$"
}
},
"value": {
Expand Down

0 comments on commit ce88dce

Please sign in to comment.