// WithField is convenience wrapper around WithFields.
544456
func WithField(ctx context.Context, key, value string) context.Context {
	return WithFields(ctx, logrus.Fields{key: value})
}
1041367
func fieldWithKey(s interface{}, key string) (string, error) {
	st := reflect.TypeOf(s)
	if st.Kind() == reflect.Ptr {
		st = st.Elem()
	}

	for i := 0; i <= st.NumField()-1; i++ {
		field := st.Field(i)

		if confkey, ok := field.Tag.Lookup("confkey"); ok {
			if confkey == key {
				return field.Name, nil
			}
		}
	}

	return "", fmt.Errorf("can't find any structure element configured with confkey '%s'", key)
}
839250
func (builder *FetchCounterCommandBuilder) WithKey(key string) *FetchCounterCommandBuilder {
	builder.protobuf.Key = []byte(key)
	return builder
}
1365123
func WithForce(ctx context.Context, force bool) context.Context {
	return context.WithValue(ctx, ctxKeyForce, force)
}
780285
func (a *CompositeAggregationDateHistogramValuesSource) Field(field string) *CompositeAggregationDateHistogramValuesSource {
	a.field = field
	return a
}
534620
func (fl *TagFieldList) AddField(field TagField) {
	fl.fields = append(fl.Fields(), field)
}
208877
func (a *DateHistogramAggregation) Field(field string) *DateHistogramAggregation {
	a.field = field
	return a
}
1171232
func (builder *UpdateMapCommandBuilder) WithKey(key string) *UpdateMapCommandBuilder {
	builder.protobuf.Key = []byte(key)
	return builder
}
150153
func (l Logger) With(keyvals ...interface{}) Logger {
	return Logger{
		Writer:    l.Writer,
		Formatter: l.Formatter,
		context:   append(l.context, keyvals...),
	}
}
498632
func (entry *Entry) WithError(err error) *Entry {
	return entry.WithField(ErrorKey, err)
}
1170485
func (r *SearchRequest) DocValueFieldWithFormat(field DocvalueField) *SearchRequest {
	r.searchSource = r.searchSource.DocvalueFieldWithFormat(field)
	return r
}
1268823
func (builder *SearchCommandBuilder) WithReturnFields(fields ...string) *SearchCommandBuilder {
	builder.protobuf.Fl = make([][]byte, len(fields))
	for i, f := range fields {
		builder.protobuf.Fl[i] = []byte(f)
	}
	return builder
}
461929
func (s *SearchSource) DocvalueFieldsWithFormat(docvalueFields ...DocvalueField) *SearchSource {
	s.docvalueFields = append(s.docvalueFields, docvalueFields...)
	return s
}
367092
func (builder *SearchCommandBuilder) WithSortField(sortField string) *SearchCommandBuilder {
	builder.protobuf.Sort = []byte(sortField)
	return builder
}
323198
func (l *Logger) WithFields(fields Fielder) *Entry {
	return NewEntry(l).WithFields(fields.Fields())
}
272618
func (b *CollapseBuilder) Field(field string) *CollapseBuilder {
	b.field = field
	return b
}
250788
func (entry *Entry) WithFields(fields lg.Fields) *Entry {
	data := make(lg.Fields, len(entry.fields)+len(fields))
	for k, v := range entry.fields {
		data[k] = v
	}
	for k, v := range fields {
		data[k] = v
	}
	return &Entry{logger: entry.logger, fields: data, lgEntry: entry.lgEntry}
}