config.go 815 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package config
  2. import (
  3. "time"
  4. "zero/kq"
  5. )
  6. type (
  7. Condition struct {
  8. Key string
  9. Value string
  10. Type string `json:",default=match,options=match|contains"`
  11. Op string `json:",default=and,options=and|or"`
  12. }
  13. ElasticSearchConf struct {
  14. Hosts []string
  15. DailyIndexPrefix string
  16. TimeZone string `json:",optional"`
  17. MaxChunkBytes int `json:",default=1048576"`
  18. Compress bool `json:",default=false"`
  19. }
  20. Filter struct {
  21. Action string `json:",options=drop|remove_field"`
  22. Conditions []Condition `json:",optional"`
  23. Fields []string `json:",optional"`
  24. }
  25. Config struct {
  26. Input struct {
  27. Kafka kq.KqConf
  28. }
  29. Filters []Filter
  30. Output struct {
  31. ElasticSearch ElasticSearchConf
  32. }
  33. GracePeriod time.Duration `json:",default=10s"`
  34. }
  35. )