Logstash并从关系表中查找其他数据?

时间:2019-04-16 21:30:57

标签: amazon-web-services elasticsearch aws-lambda logstash kibana

我每天都会发布移动应用日志数据(最终将是数据流)。我正在寻找用于处理此日志数据和提供分析的不同解决方案。我正在考虑使用Logstash / elasticsearch / kibana组合,但是我们在Redshift数据库中存储了有关用户的其他数据。因此,除了移动数据外,我还想在与移动应用进行交互时从redshift中获取有关用户的其他数据。

但是,我在某些地方读到,通过logstash进行实际的数据库查询是不可行的,但是您可以使用字典文件来查找每个用户。

关于这种方法,我有两个问题

  1. 此查找文件的大小是否有限制?我的记录是<50万条记录,所以我想那会很好吗?
  2. 从redshift表创建查找文件的过程是否可以完全自动化(最好是通过aws服务)-即每天晚上将查找表刷新并发布到logstash,然后用于Kibana中的分组讨论

我们当前正在执行的方法是使用lambda函数处理每日的jason文件,将其发布到s3,然后将其读取到redshift表中。然后,将这些数据处理为会话,并与其他表合并以生成最终的数据集以用于可视化。目前,这是在Tableau中完成的,但是我们正在探索其他选项(例如快速见解,或者可能是ELK堆栈)

只是试图弄清楚哪种解决方案可扩展到点击流数据,并且将是最有用的解决方案。

谢谢!

1 个答案:

答案 0 :(得分:2)

logstash 7 has a jdbc_streaming filter plugin for dynamically adding stuff to your events, as well as the jdbc_static filter for static stuff.

As you found, you can also use the translate filter. The man page says they've tested "very large" datasets up to 100,000 entries, so your dataset may require some testing. The good part about this filter is that it will reload the data when it detects a change, so you can publish the data on your own schedule (e.g. cron) without restarting logstash. Be on the lookout for events that don't get the translated value, which might be a sign that your publishing frequency should be updated.