示例#1
0
文件: gog.go 项目: strebul/gogy
			TimeEnd:   time.Now(),
			Size:      gogSize,
			Order:     "desc",
		}

		client := component.Client{
			Host:     config.ReadString("logstash.host"),
			Login:    config.ReadString("logstash.login"),
			Password: config.ReadString("logstash.password"),
		}
		list := client.FindLogs(request)

		decorator := component.Decorator{}

		decorator.DecorateRequest(request)
		decorator.DecorateList(list, true)

		return nil
	},
}

func init() {
	GogCmd.Flags().StringVarP(&gogLevel, "log-level", "l", "", "~debug or warning,error")
	GogCmd.Flags().IntVarP(&gogSize, "size", "s", 100, "")
	GogCmd.Flags().IntVarP(&gogDuration, "duration", "d", 24, "")
	GogCmd.Flags().StringVarP(&gogScriptId, "script-id", "", "", "")
	GogCmd.Flags().StringVarP(&gogSessionId, "session-id", "", "", "")
	GogCmd.Flags().StringVarP(&gogMessage, "message", "m", "", "")
	GogCmd.Flags().StringVarP(&gogObject, "object", "o", "", "")
}