在hbase中的一个rowkey上进行多次搜索

时间:2017-06-14 16:27:09

标签: hbase

我想在hbase上使用多个参数进行搜索。我正在使用JAVA。我有很多数据如下;

 2017-06-14T13:49:41.677Z,0000000000000001,192.168.028.056  column=log_info:log_data, timestamp=1497452872849, value=log_description=s1<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            872849,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:41.677Z,0000000000000002,192.168.028.056  column=log_info:log_data, timestamp=1497452872891, value=log_description=s2<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            872891,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:41.677Z,null,null                         column=log_info:log_data, timestamp=1497452872875, value=log_description=s3<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            872874,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:42.678Z,0000000000000001,192.168.028.056  column=log_info:log_data, timestamp=1497452872903, value=log_description=s1<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            872903,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:42.678Z,0000000000000002,192.168.028.056  column=log_info:log_data, timestamp=1497452872943, value=log_description=s2<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            872943,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:42.678Z,null,null                         column=log_info:log_data, timestamp=1497452872920, value=log_description=s3<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            872920,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:43.677Z,0000000000000001,192.168.028.056  column=log_info:log_data, timestamp=1497452872972, value=log_description=s1<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            872971,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:43.677Z,0000000000000002,192.168.028.056  column=log_info:log_data, timestamp=1497452873027, value=log_description=s2<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            873027,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:43.677Z,null,null                         column=log_info:log_data, timestamp=1497452872999, value=log_description=s3<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            872998,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:44.677Z,0000000000000001,192.168.028.056  column=log_info:log_data, timestamp=1497452873061, value=log_description=s1<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            873060,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:44.677Z,null,null                         column=log_info:log_data, timestamp=1497452873088, value=log_description=s3<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            873088,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:44.678Z,0000000000000002,192.168.028.056  column=log_info:log_data, timestamp=1497452873107, value=log_description=s2<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            873107,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:45.678Z,0000000000000001,192.168.028.056  column=log_info:log_data, timestamp=1497452873256, value=log_description=s1<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            873253,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:45.678Z,0000000000000002,192.168.028.056  column=log_info:log_data, timestamp=1497452873364, value=log_description=s2<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            873364,log_module=rconn                                                                                                                                                     
 2017-06-14T13:49:45.678Z,null,null                         column=log_info:log_data, timestamp=1497452873307, value=log_description=s3<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452
                                                            873307,log_module=rconn                                                                                                                                                     
7815 row(s) in 2.1180 seconds

例如;我想在这一行上搜索“log_level = WARN AND log_module = rconn”

2017-06-14T13:15:35.678Z,0000000000000001,192 column=log_info:log_data, timestamp=1497452705180, value=log_description=s1<->tcp:192.168.28.56:6633: connection failed (Connection refused),log_level=WARN,log_date=1497452705179,log_module=rconn 

我可以使用正则表达式过滤器吗?

1 个答案:

答案 0 :(得分:0)

我猜你可以在HBase参考指南中使用RegexStringComparator