logger_cassandra.cql 613 B

12345678910111213141516171819202122232425
  1. /**
  2. * 创建轨迹表
  3. */
  4. CREATE TABLE log_info (
  5. app_name text,
  6. req_date text,
  7. req_time text,
  8. login_id text,
  9. req_method text,
  10. req_url text,
  11. req_proto text,
  12. req_ua text,
  13. req_referer text,
  14. req_post_data text,
  15. resp_time text,
  16. resp_body text,
  17. resp_code text,
  18. resp_msg text,
  19. resp_data text,
  20. cost_time double,
  21. primary key((app_name, req_date), req_time, login_id)
  22. ) WITH CLUSTERING ORDER BY (req_time DESC)
  23. AND COMPACTION = {'class': 'TimeWindowCompactionStrategy',
  24. 'compaction_window_unit': 'DAYS',
  25. 'compaction_window_size': 1};