# 원본
[2023-08-09 09:24:59,319] 46.174.191.28 - - GET / HTTP/1.1 404
# 정규식
\\[(?<time>[^\\]]*)\\] (?<host>[^ ]*) [^ ]* [^ ]* (?<method>\\S+) (?<path>\\S+) (?<version>\\S+) (?<code>\\S+)
# 결과
time 2023-08-09 12:29:15,102
host 127.0.0.1
method GET
path /v1/color/red
version HTTP/1.1
code 200
# 원본
[2023-08-09 09:24:59,319] 46.174.191.28 - - GET / HTTP/1.1 404
# 정규식
((?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2}) (?<hour>\\d{2}):(?<minute>\\d{2}):(?<second>\\d{2}),(?<milisecond>\\d{3}))] (?<host>[^ ]*) [^ ]* [^ ]* (?<method>\\S+) (?<path>\\S+) (?<version>\\S+) (?<code>\\S+)
# 결과
year 2023
month 08
day 09
hour 09
minute 24
second 59
milisecond 319
host 46.174.191.28
method GET
path /
version HTTP/1.1
code 404
# 원본
[2023-08-09 09:24:59,319]
# 정규식
(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2}) (?<hour>\\d{2}):(?<minute>\\d{2}):(?<second>\\d{2}),(?<milisecond>\\d{3})
# 결과
year 2023
month 08
day 09
hour 09
minute 24
second 59
milisecond 319
# 원본
10.0.12.199 - [Wed, 04 Oct 2023 21:55:24 KST] GET /v1/color/red HTTP/1.1 200 56.261µs
# 정규삭
^(?<ip>\\S+) - \\[(?<timestamp>[^\\]]+)\\] (?<http_method>\\S+) (?<request_path>\\S+) (?<http_version>\\S+) (?<http_status>\\d+) (?<response_time>[^\\s]+)µs
# 결과
ip 10.0.12.199
timestamp Wed, 04 Oct 2023 21:55:24 KST
http_method GET
request_path /v1/color/red
http_version HTTP/1.1
http_status 200
response_time 56.261
# 원본
[GIN] 2023/10/08 - 10:45:59 | 200 | 3.215811ms | ::1 | GET "/image"
# 정규식
\\[GIN\\]([\\s]+)(?<timestamp>[^\\|]+)([\\s]+)\\|([\\s]+)(?<code>[\\S]+)([\\s]+)\\|([\\s]+)(?<latency>[\\S]+)([\\s]+)\\|([\\s]+)(?<ip>[\\S]+)([\\s]+)\\|([\\s]+)(?<method>[\\S]+)([\\s]+)(?<path>[\\S]+)
# 결과
timestamp 2023/10/10 - 13:55:36
code 200
latency 1.008989ms
ip 192.168.1.100
method GET
path /index.html