#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    176
    Rep Power
    0

    REGex formatting SSH log data string


    Hey all I am terrible at trying to figure out this Regex! It's, like everyone else, doesn't make much since.

    The string looks like this:

    Code:
    15:26:04,017 INFO [stdout] (Log4j2-xxxxxxxxx-1) 2019-04-23 15:26:03,945 [ http-xxxxxxxxx-4] [ STANDARD] [ ] [ xxxxxxxxx:8] (rnal.loaders.xxxxxxxxx) INFO xxxxxxxxx.xxxxxxxxx.xxxxxxxxx.xxxxxxxxx|1xxxxxxxxx4|Rest|SystemManagement|v2|importxxxxxxxxxd1070581a|xxxxxxxxxPSUYP7A - The import WORK- PxxxxxxxxxWARNING #xxxxxxxxx.591 GMT
    The pattern looks like this when breaking the above up:
    Code:
    time,x INFO [x] (x) date time [x] [x] [x] [x] (x) INFO x|x|x|x|x|x
    Someone whos much knowleageble about this Regex stuff than me will probably take 2 minutes and have it working. Me? I am a lot longer without results....
  2. #2
  3. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,977
    Rep Power
    9647
    Basically, every "x" can be a
    Code:
    .*?
    Wrap in parentheses to capture, and remember to escape the literal []()| characters.

IMN logo majestic logo threadwatch logo seochat tools logo