date with timezone

40Dialogues's Avatar

40Dialogues

Nov 16, 2014 @ 09:07 PM

I have different timezones in a single log.

Some lines

... [15/Nov/2014:19:09:33 -0600] ...

Other lines

... [16/Nov/2014:03:48:07 +0000] ...

So, can date type deal with it?

I tried giving O parameter in match, but it didn't seem to take effect.

  1. Support Staff 1 Posted by potsky on Nov 16, 2014 @ 09:43 PM

    potsky's Avatar

    Not yet... I'll add this tomorrow !

    Potsky
    www.potsky.com

    Do you Pimp my Log ?

  2. 2 Posted by 40Dialogues on Nov 16, 2014 @ 09:50 PM

    40Dialogues's Avatar

    Super! Thank you for hearing. Looking forward to it.

  3. Support Staff 3 Posted by potsky on Nov 17, 2014 @ 08:06 AM

    potsky's Avatar

    Hi !

    In fact it is supported if you use the Date match format as an array and not object :

    {
      "SOFTWARE_ID": {
        "display"   : "SOFTWARE NAME",
        "path"      : "SOFTWARE PATH",
        "format"    : {
          "multiline": "Error",
          "regex"    : "|^\\[(.*)-(.*)-(.*):(.*):(.*):(.*) (.*)\\] (.*)$|U",
          "match"    : {
      "Date":[ 3, "\/", 2, "\/", 1, " ", 4, ":", 5, ":", 6, " ", 7 ],
      "Error":8
    },
          "types"    : {
      "Date":"date:d\/m\/Y H:i:s \/100",
      "Error":"txt"
    }
        }
      }
    }
    

    You just need to append the timezone at the end of the date array.

    But if you use an match object description for the date, it will not work now. So I will add a z parameter for the timezone and it will be ok :

    {
      "Date":{
        "Y":3,
        "m":2,
        "d":1,
        "H":4,
        "i":5,
        "s":6,
        "z" : 7
      },
      "Error":8
    }
    

    I will then add this by default in auto configuration.

  4. potsky closed this discussion on Nov 17, 2014 @ 10:17 AM.

  5. 40Dialogues re-opened this discussion on Nov 18, 2014 @ 12:20 AM

  6. 4 Posted by 40Dialogues on Nov 18, 2014 @ 12:20 AM

    40Dialogues's Avatar

    z is working fine on 1.5.2. Thank you so much.

  7. 40Dialogues closed this discussion on Nov 18, 2014 @ 12:20 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac