Documentation
¶
Index ¶
- Constants
- Variables
- func String(str string) *string
- type Client
- func (hec *Client) SetChannel(channel string)
- func (hec *Client) SetHTTPClient(client *http.Client)
- func (hec *Client) SetKeepAlive(enable bool)
- func (hec *Client) SetMaxContentLength(size int)
- func (hec *Client) SetMaxRetry(retries int)
- func (hec *Client) WriteBatch(events []*Event) error
- func (hec *Client) WriteEvent(event *Event) error
- func (hec *Client) WriteRaw(reader io.ReadSeeker, metadata *EventMetadata) error
- type Cluster
- func (c *Cluster) SetChannel(channel string)
- func (c *Cluster) SetHTTPClient(httpClient *http.Client)
- func (c *Cluster) SetKeepAlive(enable bool)
- func (c *Cluster) SetMaxContentLength(size int)
- func (c *Cluster) SetMaxRetry(retries int)
- func (c *Cluster) WriteBatch(events []*Event) error
- func (c *Cluster) WriteEvent(event *Event) error
- func (c *Cluster) WriteRaw(reader io.ReadSeeker, metadata *EventMetadata) error
- type Event
- type EventMetadata
- type HEC
- type Response
Constants ¶
View Source
const ( StatusSuccess = 0 StatusTokenDisabled = 1 StatusTokenRequired = 2 StatusInvalidAuthorization = 3 StatusInvalidToken = 4 StatusNoData = 5 StatusInvalidDataFormat = 6 StatusIncorrectIndex = 7 StatusInternalServerError = 8 StatusServerBusy = 9 StatusChannelMissing = 10 StatusInvalidChannel = 11 StatusEventFieldRequired = 12 StatusEventFieldBlank = 13 StatusAckDisabled = 14 )
Response status codes
Variables ¶
View Source
var ErrEventTooLong = errors.New("Event length is too long")
Functions ¶
Types ¶
type Client ¶
type Client struct {
HEC
// contains filtered or unexported fields
}
func (*Client) SetChannel ¶
func (*Client) SetHTTPClient ¶
func (*Client) SetKeepAlive ¶
func (*Client) SetMaxContentLength ¶
func (*Client) SetMaxRetry ¶
func (*Client) WriteBatch ¶
func (*Client) WriteEvent ¶
func (*Client) WriteRaw ¶
func (hec *Client) WriteRaw(reader io.ReadSeeker, metadata *EventMetadata) error
type Cluster ¶
type Cluster struct {
HEC
// contains filtered or unexported fields
}
func (*Cluster) SetChannel ¶
func (*Cluster) SetHTTPClient ¶
func (*Cluster) SetKeepAlive ¶
func (*Cluster) SetMaxContentLength ¶
func (*Cluster) SetMaxRetry ¶
func (*Cluster) WriteBatch ¶
func (*Cluster) WriteEvent ¶
func (*Cluster) WriteRaw ¶
func (c *Cluster) WriteRaw(reader io.ReadSeeker, metadata *EventMetadata) error
type Event ¶
type Event struct {
Host *string `json:"host,omitempty"`
Index *string `json:"index,omitempty"`
Source *string `json:"source,omitempty"`
SourceType *string `json:"sourcetype,omitempty"`
Time *string `json:"time,omitempty"`
Event interface{} `json:"event"`
}
func (*Event) SetSourceType ¶
type EventMetadata ¶
type HEC ¶
type HEC interface {
SetHTTPClient(client *http.Client)
SetKeepAlive(enable bool)
SetChannel(channel string)
SetMaxRetry(retries int)
SetMaxContentLength(size int)
// WriteEvent writes single event via HEC json mode
WriteEvent(event *Event) error
// WriteBatch writes multiple events via HCE batch mode
WriteBatch(events []*Event) error
// WriteRaw writes raw data stream via HEC raw mode
WriteRaw(reader io.ReadSeeker, metadata *EventMetadata) error
}
func NewCluster ¶
Click to show internal directories.
Click to hide internal directories.