log_config.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package alils
  2. type InputDetail struct {
  3. LogType string `json:"logType"`
  4. LogPath string `json:"logPath"`
  5. FilePattern string `json:"filePattern"`
  6. LocalStorage bool `json:"localStorage"`
  7. TimeFormat string `json:"timeFormat"`
  8. LogBeginRegex string `json:"logBeginRegex"`
  9. Regex string `json:"regex"`
  10. Keys []string `json:"key"`
  11. FilterKeys []string `json:"filterKey"`
  12. FilterRegex []string `json:"filterRegex"`
  13. TopicFormat string `json:"topicFormat"`
  14. }
  15. type OutputDetail struct {
  16. Endpoint string `json:"endpoint"`
  17. LogStoreName string `json:"logstoreName"`
  18. }
  19. type LogConfig struct {
  20. Name string `json:"configName"`
  21. InputType string `json:"inputType"`
  22. InputDetail InputDetail `json:"inputDetail"`
  23. OutputType string `json:"outputType"`
  24. OutputDetail OutputDetail `json:"outputDetail"`
  25. CreateTime uint32
  26. LastModifyTime uint32
  27. project *LogProject
  28. }
  29. // GetAppliedMachineGroup returns applied machine group of this config.
  30. func (c *LogConfig) GetAppliedMachineGroup(confName string) (groupNames []string, err error) {
  31. groupNames, err = c.project.GetAppliedMachineGroups(c.Name)
  32. return
  33. }