Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. # select regexp_replace(x, E'.*eventType=(\\S+).*', E'\\1'), regexp_replace(x, E'.*emailAddress=(\\S+).*', E'\\1') from ( values ('[2010-10-19 20:04:15,099] INFO [task-scheduler-2] com.ebates.acxiomInstantEventProcessor.CustomMessageHandler Message is [Payload=Event creation date is Tue Oct 19 20:04:15 PDT 2010 delivery attempts 0 payload is {userId=40037081, gift=0, merch=Buy.com, emailAddress=veracellular@optonline.net, autoLoginId=3HheFfypoxurQrfxc4UFBQ%3D%3D, merchantSession=245481087, date=10/19/10, eventType=shopperNotification, merchantId=1440}][Headers={springintegration_jms_redelivered=false, springintegration_id=22732875-dedb-4fde-ae05-ce92890952a9, springintegration_timestamp=1287543855099, springintegration_jms_messageId=ID:prod-batch1-50134-1286490720558-0:0:1:1:39125}]') ) as q(x);
  2. regexp_replace | regexp_replace
  3. ----------------------+-----------------------------
  4. shopperNotification, | veracellular@optonline.net,
  5. (1 row)
  6.  
  7.  
  8. Can I somehow get rid of the comma in the end. Also is it possible to get the time stamp 2010-10-19 20:04:15
  9. using the magic of regular expressions. such that the results lok like
  10.  
  11.  
  12. thetime | regexp_replace | regexp_replace --------------------------------------------------+---------------------------
  13. 2010-10-19 20:04:15 | shopperNotification | veracellular@optonline.net
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement