Documentation ¶
Index ¶
- func AbsHome(path string) string
- func GetSearchDir() string
- func SearchInteractive() string
- func ValidSPL(path string) bool
- type Connection
- func (conn Connection) AppInspect(path string) (string, error)
- func (conn Connection) GetMessage(name string) ([]Message, error)
- func (conn *Connection) InspectControl(endpoint string) (string, error)
- func (conn Connection) InstallApp(path string, update bool) (string, error)
- func (conn *Connection) Login() (SessionKey, error)
- func (conn *Connection) RestartServer() (string, error)
- func (conn Connection) SearchSync(searchString string, outputMode string) (string, error)
- func (conn Connection) SendMessage(message *Message) (string, error)
- type Message
- type MessageContent
- type MessageSeverity
- type Messages
- type SessionKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSearchDir ¶
func GetSearchDir() string
GetSearchDir runs a prompt for the use to check where their spl files are for Splunk searching
func SearchInteractive ¶
func SearchInteractive() string
SearchInteractive runs the interactive variant of SearchSync
Types ¶
type Connection ¶
type Connection struct {
Username, Password, BaseURL string
// contains filtered or unexported fields
}
Connection contains the primary auth parameters for connecting to Splunk
func CreateConnectionFromEnvironment ¶
func CreateConnectionFromEnvironment() (*Connection, error)
CreateConnectionFromEnvironment sets up a splunk connection
func (Connection) AppInspect ¶
func (conn Connection) AppInspect(path string) (string, error)
AppInspect inspects queried app's details and properties.
func (Connection) GetMessage ¶
func (conn Connection) GetMessage(name string) ([]Message, error)
GetMessage fetches and unmarshalls a message from Splunk
func (*Connection) InspectControl ¶
func (conn *Connection) InspectControl(endpoint string) (string, error)
InspectControl is used to list actions that can be performed at the queried endpoint.
func (Connection) InstallApp ¶
func (conn Connection) InstallApp(path string, update bool) (string, error)
InstallApp installs splunk apps
func (*Connection) Login ¶
func (conn *Connection) Login() (SessionKey, error)
Login connects to the Splunk server and retrieves a session key
func (*Connection) RestartServer ¶
func (conn *Connection) RestartServer() (string, error)
RestartServer is used to send a process reboot request to the Splunk instance
func (Connection) SearchSync ¶
func (conn Connection) SearchSync(searchString string, outputMode string) (string, error)
SearchSync performs a search job on splunk with the provided search string
func (Connection) SendMessage ¶
func (conn Connection) SendMessage(message *Message) (string, error)
SendMessage sends an informational message to Splunk
type Message ¶
type Message struct { Name string `json:"name"` Content MessageContent `json:"content"` }
Message contains the name and content of the message in JSON
type MessageContent ¶
type MessageContent struct { Message string `json:"message"` Severity MessageSeverity `json:"severity"` Created int64 `json:"timeCreated_epochSecs"` }
MessageContent contains the aggregation of MessageSeverity and Message
func (*MessageContent) Content ¶
func (mc *MessageContent) Content() time.Time
Content logs the time of the message
type MessageSeverity ¶
type MessageSeverity string
MessageSeverity contains the significance of a message in string form
const ( // Info is a message of type informational Info MessageSeverity = "info" // Warn is a message of type warn Warn MessageSeverity = "warn" // Error is a message of type error Error MessageSeverity = "error" )
type SessionKey ¶
type SessionKey struct {
Value string `json:"sessionKey,omitempty"`
}
SessionKey represents the JSON object returned from the Splunk authentication REST call