Skip to content

Commit

Permalink
Update subst regex to allow for colon in TZ
Browse files Browse the repository at this point in the history
* Simplify subst regex as date-parser() allows for both `-08:00` and `-0800` TZ offsets
  • Loading branch information
Mark Bonsack committed Feb 14, 2020
1 parent 3a2da35 commit 600361c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions package/etc/conf.d/log_paths/lp-fortinet_fortiweb.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ log {
};

# Fetch timezone from timezone nv pair and parse unique format (no zero padding, e.g. "-8:00" rather than "-08:00"
# Reformat to "-0800"
# Reformat to "-08:00"
rewrite {
subst('.*([\+-]\d+:\d+).*', $1, value(".kv.timezone"));
subst('([\+-])(\d)(?=:):(\d+)', "${1}0${2}${3}", value(".kv.timezone"));
subst('([\+-])(\d+):(\d+)', "$1$2$3", value(".kv.timezone"));
subst('([\+-])(\d)(?=:)(:\d+)', "${1}0${2}${3}", value(".kv.timezone"));
};

#2020-02-12,23:13:33-0800
Expand Down

0 comments on commit 600361c

Please sign in to comment.