Looking for a help to extract the data from the below log file.
Log data:
INFO : Partition test.t_abc_cdfn_gprs{schdate_year=2016, schdate_month=02, schdate_day=17, schtime_hour=01} stats: [numFiles=0, numRows=4265004, totalSize=0, rawDataSize=0]
INFO : Partition test.t_abc_glob_gprs{year=2016, month=02, day=17} stats: [numFiles=0, numRows=4265004, totalSize=0, rawDataSize=0]
INFO : Partition test.t_abc_part_gprs{part1=2016, part2=02} stats: [numFiles=0, numRows=4265004, totalSize=0, rawDataSize=0]*
Code:
echo "INFO : Partition test.t_abc_cdfn_gprs{schdate_year=2016, schdate_month=02, schdate_day=17, schtime_hour=16} stats: [numFiles=0, numRows=16123348, totalSize=0, rawDataSize=0]" | sed -n '/{/{s/.*{//;s/\}/,/;p}' | awk -F':' '{print $1}' | sed 's/stats//g' | sed 's%,%/%g'
The value I need to extract can be only Year/month/day or even it may be different format also mentioned in sample log entry, But the values will be enclosed by curly braces and variable in front like schdate=2016, etc...
Output Required:
2016/02/17/01
2016/02/17
2016/02