· 8 years ago · Apr 13, 2018, 11:04 PM
1-- Sample Data:
2-- Jun 30 2017 12:00:00 [INFO] kafkaproducer com.logger.info.nameoftheclasss.factory: this is the message coming out from the log
3use extractions;
4show tables;
5create table if not exists logdata(
6 month string,
7 date int,
8 year int,
9 time string,
10 logtype string,
11 application string,
12 class string,
13 message string
14)
15row format serde 'org.apache.hadoop.hive.serde2.RegexSerDe'
16with serdeproperties (
17 "input.regex" = "^(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\scom.logger.info.(\\S+).factory:\\s+(.*)",
18 "output.format.string" = "%1$s %2$s %3$s %4$s %5$s %6$s %7$s %8$s"
19)
20stored as textfile;