标签:blog io ar for 数据 2014 sp log on
查找第一个匹配到的元素:
> (set ‘l ‘("WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files." "recommend" "search" "test")) ("WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files." "recommend" "search" "test") > (find "WARN" l 1) 0 > (find "WARN3" l 1)
(context ‘STRING_LIST) ;; @param case-insensitive 1 for case-insensitive search or 0 for no special options (define (remove str-list str-regex case-insensitive) (do-while i (begin (set ‘i (find str-regex str-list case-insensitive)) (if i (pop str-list i)))) str-list )
;; @syntax (HIVE:show-dbs) (define (show-dbs) (set ‘r (exec (format "hive -e ‘show databases‘ 2>&1"))) (set ‘r (STRING_LIST:remove r "^WARNING.+" 1)) (set ‘r (STRING_LIST:remove r "^Logging.+" 1)) (set ‘r (STRING_LIST:remove r "^Hive.+" 1)) (set ‘r (STRING_LIST:remove r "OK" 1)) (STRING_LIST:remove r "^Time taken.+" 1) )
标签:blog io ar for 数据 2014 sp log on
原文地址:http://blog.csdn.net/csfreebird/article/details/39123397