func()

in agentcfg/elasticsearch.go [199:213]


func (f *ElasticsearchFetcher) clearScroll(ctx context.Context, scrollID string) {
	resp, err := esapi.ClearScrollRequest{
		ScrollID: []string{scrollID},
	}.Do(ctx, f.client)
	if err != nil {
		f.logger.Warn(fmt.Sprintf("failed to clear scroll: %v", err))
		return
	}

	if resp.IsError() {
		f.logger.Warn(fmt.Sprintf("clearscroll request returned error: %s", resp.Status()))
	}

	resp.Body.Close()
}