mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
Update awk comand for time_string to support pre and post 1.7 log format
This commit is contained in:
parent
c8c4788091
commit
621963cf1c
2
init/msm
2
init/msm
@ -292,7 +292,7 @@ now() {
|
|||||||
# $1: A server log line
|
# $1: A server log line
|
||||||
# returns: Time in seconds since 1970-01-01 00:00:00 UTC
|
# returns: Time in seconds since 1970-01-01 00:00:00 UTC
|
||||||
log_line_get_time() {
|
log_line_get_time() {
|
||||||
time_string="$(echo "$1" | awk '{print $1 " " $2}')"
|
time_string="$(echo "$1" | awk 'BEGIN{FS="[ \][/:]+"}; {print $1 " " $2 ":" $3 ":" $4}')"
|
||||||
date -d "$time_string" "+%s" 2> /dev/null
|
date -d "$time_string" "+%s" 2> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user