Documentation
¶
Overview ¶
Send data to an anomaly detection job for analysis.
IMPORTANT: For each job, data can be accepted from only a single connection at a time. It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list.
Index ¶
- Variables
- type NewPostData
- type PostData
- func (r PostData) Do(providedCtx context.Context) (*Response, error)
- func (r *PostData) ErrorTrace(errortrace bool) *PostData
- func (r *PostData) FilterPath(filterpaths ...string) *PostData
- func (r *PostData) Header(key, value string) *PostData
- func (r *PostData) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PostData) Human(human bool) *PostData
- func (r PostData) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *PostData) Pretty(pretty bool) *PostData
- func (r *PostData) Raw(raw io.Reader) *PostData
- func (r *PostData) Request(req *Request) *PostData
- func (r *PostData) ResetEnd(datetime string) *PostData
- func (r *PostData) ResetStart(datetime string) *PostData
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type NewPostData ¶
NewPostData type alias for index.
func NewPostDataFunc ¶
func NewPostDataFunc(tp elastictransport.Interface) NewPostData
NewPostDataFunc returns a new instance of PostData with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PostData ¶
type PostData struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PostData
Send data to an anomaly detection job for analysis.
IMPORTANT: For each job, data can be accepted from only a single connection at a time. It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list.
https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html
func (PostData) Do ¶
Do runs the request through the transport, handle the response and returns a postdata.Response
func (*PostData) ErrorTrace ¶ added in v8.14.0
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*PostData) FilterPath ¶ added in v8.14.0
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*PostData) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PostData) Human ¶ added in v8.14.0
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human
func (PostData) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*PostData) Pretty ¶ added in v8.14.0
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*PostData) Raw ¶
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*PostData) ResetEnd ¶
ResetEnd Specifies the end of the bucket resetting range. API name: reset_end
func (*PostData) ResetStart ¶
ResetStart Specifies the start of the bucket resetting range. API name: reset_start
type Request ¶ added in v8.11.0
type Request = []json.RawMessage
Request holds the request body struct for the package postdata
type Response ¶
type Response struct { BucketCount int64 `json:"bucket_count"` EarliestRecordTimestamp *int64 `json:"earliest_record_timestamp,omitempty"` EmptyBucketCount int64 `json:"empty_bucket_count"` InputBytes int64 `json:"input_bytes"` InputFieldCount int64 `json:"input_field_count"` InputRecordCount int64 `json:"input_record_count"` InvalidDateCount int64 `json:"invalid_date_count"` JobId string `json:"job_id"` LastDataTime *int64 `json:"last_data_time,omitempty"` LatestEmptyBucketTimestamp *int64 `json:"latest_empty_bucket_timestamp,omitempty"` LatestRecordTimestamp *int64 `json:"latest_record_timestamp,omitempty"` LatestSparseBucketTimestamp *int64 `json:"latest_sparse_bucket_timestamp,omitempty"` LogTime *int64 `json:"log_time,omitempty"` MissingFieldCount int64 `json:"missing_field_count"` OutOfOrderTimestampCount int64 `json:"out_of_order_timestamp_count"` ProcessedFieldCount int64 `json:"processed_field_count"` ProcessedRecordCount int64 `json:"processed_record_count"` SparseBucketCount int64 `json:"sparse_bucket_count"` }
Response holds the response body struct for the package postdata