Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

please tokenize this line with apache pig ? regex ?

please tokenize this line with apache pig ? regex ?

New Contributor

03:00:00,685 INFO [aa.com.aaaa.gm.server.ANDDefaultServiceExecuter] (http-/0.0.0.0:8080-1) [31e432d4-6a89-4828-9c24-0f1d596eed23][10.40.26.49][WEB_AUTHENTICATE] started

1 REPLY 1
Highlighted

Re: please tokenize this line with apache pig ? regex ?

Expert Contributor
-- sample.txt
-- 03:00:00,685 INFO [aa.com.aaaa.gm.server.ANDDefaultServiceExecuter] (http-/0.0.0.0:8080-1) [31e432d4-6a89-4828-9c24-0f1d596eed23][10.40.26.49][WEB_AUTHENTICATE] started


A = LOAD '/user/admin/sample.txt' AS (line:chararray);
X = FOREACH A GENERATE TOKENIZE(line, ' ');
DUMP X;

-- results
({(03:00:00,685),(INFO),([aa.com.aaaa.gm.server.ANDDefaultServiceExecuter]),((http-/0.0.0.0:8080-1)),([31e432d4-6a89-4828-9c24-0f1d596eed23][10.40.26.49][WEB_AUTHENTICATE]),(started)})