高热共公日志库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

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