You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Splunk will pick reasonable defaults if the first two are omitted.
A default index is always assigned when a token in created in Splunk.
However, the JSON request must not refer to a blank index if this
default is to be used. Without the json omitempty, the log entry is
written to the index "main" where you might not think to look.
Sourcestring`json:"source" binding:"required"`// app name
19
-
SourceTypestring`json:"sourcetype" binding:"required"`// Splunk bucket to group logs in
20
-
Indexstring`json:"index" binding:"required"`// idk what it does..
21
-
Eventinterface{} `json:"event" binding:"required"`// throw any useful key/val pairs here
16
+
Timeint64`json:"time"`// epoch time in seconds
17
+
Hoststring`json:"host"`// hostname
18
+
Sourcestring`json:"source,omitempty"`// optional description of the source of the event; typically the app's name
19
+
SourceTypestring`json:"sourcetype,omitempty"`// optional name of a Splunk parsing configuration; this is usually inferred by Splunk
20
+
Indexstring`json:"index,omitempty"`// optional name of the Splunk index to store the event in; not required if the token has a default index set in Splunk
21
+
Eventinterface{} `json:"event"`// throw any useful key/val pairs here
22
22
}
23
23
24
24
// Client manages communication with Splunk's HTTP Event Collector.
25
25
// New client objects should be created using the NewClient function.
26
26
//
27
27
// The URL field must be defined and pointed at a Splunk servers Event Collector port (i.e. https://{your-splunk-URL}:8088/services/collector).
28
28
// The Token field must be defined with your access token to the Event Collector.
29
-
// The Source, SourceType, and Index fields must be defined.
30
29
typeClientstruct {
31
30
HTTPClient*http.Client// HTTP client used to communicate with the API
0 commit comments