func NewESPollCmd()

in cmd/apmtool/espoll.go [98:125]


func NewESPollCmd(commands *Commands) *cli.Command {
	return &cli.Command{
		Name:   "espoll",
		Usage:  "poll documents from Elasticsearch",
		Action: commands.pollDocs,
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:  "query",
				Usage: "The Elasticsearch query in Query DSL. Must be set via this flag or stdin.",
			},
			&cli.StringFlag{
				Name:  "target",
				Value: "traces-*,logs-*,metrics-*",
				Usage: "Comma-separated list of data streams, indices, and aliases to search (Supports wildcards (*)).",
			},
			&cli.DurationFlag{
				Name:  "timeout",
				Value: 30 * time.Second,
				Usage: "Elasticsearch request timeout",
			},
			&cli.UintFlag{
				Name:  "min-hits",
				Value: 1,
				Usage: "When specified and > 10, this should cause the size parameter to be set.",
			},
		},
	}
}