-1
中的每一行的特定字段一边学习,我想阅读网络日志,并从中提取几个字段。 Web日志会像下面斯卡拉 - 打印从文件
147.172.225.10 - 16401 [16/Sep/2013:23:52:35 +0100] "GET /KBDOC-00057.html HTTP/1.0" 200 11761 "http://www.newbie.com" "test F20L"
147.172.225.10 - 16401 [16/Sep/2013:23:52:35 +0100] "GET /theme.css HTTP/1.0" 200 12353 "http://www.newbie.com" "test Mobile Browser Sorrento F20L"
23.53.29.101 - 32693 [16/Sep/2013:23:49:50 +0100] "GET /KBDOC-00035.html HTTP/1.0" 200 9337 "http://www.newbie.com" "test Mobile Browser i3"
我需要提取刚刚从日志中的IP地址和用户ID(第三场)和打印为
147.172.225.10/16401
147.172.225.10/16401
23.53.29.101/32693
如果我不得不使用地图或flatMap,可能有人帮助我如何让我知道是否有更好的方式来完成它。提前致谢 !!