#214 LogFormat: make colon in time zone specification optional

open
nobody
None
1
2015-07-30
2015-07-13
No

Hi Laurent,

let me state briefly my use case and problem:
- I like date/time to be specified absolutely, so there is no doubt that it means
- thus the only applicable format is full ISO 8601 format, which contains no literal names, weird order of month/day, and exact TZ offset.

Apache does not support full ISO 8601 date+time+tz format. The next best option is to use %{}t directive to mimic it, like this:

LogFormat "%{%Y-%m-%dT%H:%M:%S%z}t ..." format-name

Unfortunately this does not mimic it completely, as strftime's %z does not include colon character separator between hour and minute in TZ offset specification.

Sample full ISO 8601 time: 2015-07-10T22:38:39+00:00
Best Apache approximation: 2015-07-10T22:38:39+0000 (note the missing colon)

AWStats supports full ISO8601 time specification (compliments!). But it would be splendid, if the colon character in time5 would be made optional, so that either +/-xx:xx and +/-0000 would match.

What do you think?

The patch is available here:
http://source.a2o.si/patches/awstats-7.3-logformat-timezone-colon-optional.diff

I can provide a git pull request for this, if requested.

b.

Related

Patches: #214

Discussion

  • Laurent Destailleur (Eldy)

    Yes please, can ou send a Pull request on the develop branch ?

    2015-07-14 1:45 GMT+02:00 Boštjan Škufca bostjanskufca@users.sf.net:


    [patches:#214] LogFormat: make colon in time zone specification
    optional

    Status: open
    Group:
    Created: Mon Jul 13, 2015 11:45 PM UTC by Boštjan Škufca
    Last Updated: Mon Jul 13, 2015 11:45 PM UTC
    Owner: nobody

    Hi Laurent,

    let me state briefly my use case and problem:
    - I like date/time to be specified absolutely, so there is no doubt that
    it means
    - thus the only applicable format is full ISO 8601 format, which contains
    no literal names, weird order of month/day, and exact TZ offset.

    Apache does not support full ISO 8601 date+time+tz format. The next best
    option is to use %{}t directive to mimic it, like this:

    LogFormat "%{%Y-%m-%dT%H:%M:%S%z}t ..." format-name

    Unfortunately this does not mimic it completely, as strftime's %z does not
    include colon character separator between hour and minute in TZ offset
    specification.

    Sample full ISO 8601 time: 2015-07-10T22:38:39+00:00
    Best Apache approximation: 2015-07-10T22:38:39+0000 (note the missing
    colon)

    AWStats supports full ISO8601 time specification (compliments!). But it
    would be splendid, if the colon character in time5 would be made optional,
    so that either +/-xx:xx and +/-0000 would match.

    What do you think?

    The patch is available here:

    http://source.a2o.si/patches/awstats-7.3-logformat-timezone-colon-optional.diff

    I can provide a git pull request for this, if requested.

    b.


    Sent from sourceforge.net because you indicated interest in <
    https://sourceforge.net/p/awstats/patches/214/>

    To unsubscribe from further messages, please visit <
    https://sourceforge.net/auth/subscriptions/>

    --
    EMail: eldy@destailleur.fr
    Web: http://www.destailleur.fr


    Google+: https://plus.google.com/+LaurentDestailleur/
    Facebook: https://www.facebook.com/Destailleur.Laurent
    Twitter: http://www.twitter.com/eldy10


     

    Related

    Patches: #214

    • Boštjan Škufca

      Do you have a git repo clone somewhere else than on sourceforge? It is inaccessible ATM.

      b.

      PS: I scratched my head for about an hour when I first saw your name in AWStats documentation/history and it sounded familiar. On an unrelated subject I must confess that hacking Dolibarr's invoice templates is a journey for french-almost-illiterate. :)

       
  • Boštjan Škufca

    Ah crap. After half of hour of regex juggling I figure out that changes in develop branch already contain fix for this :)

    Anyway, here is pull request with:
    - updated documentation about this
    - add support for "Z" only, which completes ISO 8601 support
    - make whole timezone part optional, to support the most datetime formats

    https://github.com/teonsystems/awstats/tree/enhancement/logformat-iso-tz-updates

    b.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks