##今天建文导出了唱吧最近几天的转化日志,随后过滤出来38条记录需要查找idfa。
## 现在是需要通过clickid查找出来点击日志里的idfa。
## clickid本身可以当作mongodb的集合的查询字段,但是集合名称与日期有关,需要从clickid计算出日期。
##bash脚本是可以实现上述功能的,如下为部分实例:
cat clickidtoidfa.txt |cut -d "_" -f 3|tr -d \"|sort -n
##上述命令组合筛选出来了时间戳(13位)并且排序了,然后使用tstotime别名得到时间范围2017-05-21T19:43:47+0800到2017-05-24T19:49:07+0800
。
##上述思路是有点偏的(排序是不需要的只是当时的偏路)
##bash实现伪代码:
while read line in clickidtoidfa.txt
for line in $(awk 'BEGIN{IFS="_"}{print $3}|cut -f 1-13')
day=tstotime $ts
mongo query -c mclog -c click_$day -q "{clickid:'$line'}"