简体   繁体   中英

Using grep map-reduce program on hadoop

I am using hadoop grep program which comes embedded in the example jar file.

hadoop jar /usr/lib/hadoop/hadoop-examples.jar grep /user/tavasthi/log /user/tavasthi/log_result_output 'ip1 | ip2'

But the results are coming wrong. My intention is to search for records in which there is an occurence of ip1 or ip2.

Kindly suggest.

Thanking you in anticipation! Tapan

Your regex expression is most probably wrong: 'ip1 | ip2' 'ip1 | ip2' should probably be '(ip1|ip2)' - noting the lack of whitespace and additional parenthesis around the two terms your are looking for

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM