PHP CUT and FILTER

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

navsan
New php-forum User
New php-forum User
Posts: 1
Joined: Sat Jan 12, 2013 8:22 am

PHP CUT and FILTER

Postby navsan » Sat Jan 12, 2013 8:27 am

Hi All,

i have a log file .i want to cut and filter using some conditions in PHP
condition 1:first i want to filter the datas having "P12345"
condition 2:cut the session ID and time stamp(i.e 77087432[11/29/2012 08:57:02])for all user id "P12345"

Code: Select all

P123456_77087432[11/29/2012 08:57:02]:INFO: login
P123456_77087432[11/29/2012 08:57:02]:INFO:UpdateInfo o
P12345_WorkItemID = 1-ASSDFDFS##1232134214_0386052691
P123456_77087432[11/29/2012 09:05:37]:ERROR:Failed on invoking GetWoritem
P12345_WorkItemID = 1-ASSDFDFS##1232134214_0386052691
P123456_77087432[11/29/2012 09:05:37]:ERROR:Unable to retrive work item ibute
P123456_77087432[11/29/2012 09:05:37]:WARNING:Failed at RenderFormatString,
P12345_WorkItemID = 1-ASSDFDFS##1232134214_0386052691
P12345_WorkItemID = 1-ASSDFDFS##1232134214_0386052691
P123456_77087432[11/29/2012 09:05:37]:WARNING:RenderFormatString: Could not find
P123456_77087432[11/29/2012 09:05:37]:WARNING:RenderFormatString: Could not find
P123456_77087432[11/29/2012 09:05:37]:WARNING:RenderFormatString: Could not find


and the out put should be like this


Code: Select all

77087432[11/29/2012 08:57:02]
77087432[11/29/2012 08:57:02]
77087432[11/29/2012 09:05:37]
77087432[11/29/2012 09:05:37]
77087432[11/29/2012 09:05:37]
77087432[11/29/2012 09:05:37]
77087432[11/29/2012 09:05:37]
77087432[11/29/2012 09:05:37]

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests