Documentation
¶
Overview ¶
Copyright 2020-2024 NGR Softlab
Copyright 2020-2024 NGR Softlab ¶
Copyright 2020-2024 NGR Softlab ¶
Copyright 2020-2024 NGR Softlab ¶
Copyright 2020-2024 NGR Softlab ¶
Copyright 2020-2024 NGR Softlab
Index ¶
- Constants
- func CEFFormatter(p syslog.Priority, hostname, tag, content string) string
- func CheckKey(testKey string) bool
- func GetLongNameByShort(longName string) string
- func GetShortNameByLong(shortName string) string
- func MakeCefString(header CefHeader, contentMap map[string]interface{}, ...) (string, error)
- func NewSyslogWriter(params SyslogParams, formatter syslog.Formatter) (*syslog.Writer, error)
- func NewSyslogWriterWithTimeout(params SyslogParams, formatter syslog.Formatter, timeout time.Duration) (*syslog.Writer, error)
- func SendListToSyslog(params SyslogParams, formatter syslog.Formatter, msgList []string) error
- func SendListToSyslogWithTimeout(params SyslogParams, formatter syslog.Formatter, msgList []string, ...) error
- func SendSingleSyslogMsg(params SyslogParams, formatter syslog.Formatter, msg string) error
- func SendSingleSyslogMsgWithTimeout(params SyslogParams, formatter syslog.Formatter, msg string, ...) error
- type CefHeader
- type FieldInfo
- type SyslogParams
Constants ¶
const ( SimpleLevel = iota // just write DebugLevel InfoLevel WarningLevel ErrorLevel AlertLevel CriticalLevel )
Syslog levels
Variables ¶
This section is empty.
Functions ¶
func CEFFormatter ¶
CEFFormatter custom Formatter for CEF (for github.com/RackSec/srslog lib)
func GetLongNameByShort ¶ added in v1.0.1
func GetShortNameByLong ¶ added in v1.0.1
func MakeCefString ¶
func MakeCefString(header CefHeader, contentMap map[string]interface{}, keysAreLong, useDefault, useCustom bool) (string, error)
MakeCefString making CEF string from custom header params and content map
func NewSyslogWriter ¶
NewSyslogWriter create new syslog writer with params and custom formatter
func NewSyslogWriterWithTimeout ¶ added in v1.0.6
func NewSyslogWriterWithTimeout(params SyslogParams, formatter syslog.Formatter, timeout time.Duration) (*syslog.Writer, error)
NewSyslogWriterWithTimeout create new syslog writer with params and custom formatter + timeout
func SendListToSyslog ¶
func SendListToSyslog(params SyslogParams, formatter syslog.Formatter, msgList []string) error
SendListToSyslog - Send list of msgs to syslog
func SendListToSyslogWithTimeout ¶ added in v1.0.6
func SendListToSyslogWithTimeout(params SyslogParams, formatter syslog.Formatter, msgList []string, timeout time.Duration) error
SendListToSyslogWithTimeout - Send list of msgs to syslog with timeout
func SendSingleSyslogMsg ¶
func SendSingleSyslogMsg(params SyslogParams, formatter syslog.Formatter, msg string) error
SendSingleSyslogMsg - Send single syslog msg
func SendSingleSyslogMsgWithTimeout ¶ added in v1.0.6
func SendSingleSyslogMsgWithTimeout(params SyslogParams, formatter syslog.Formatter, msg string, timeout time.Duration) error
SendSingleSyslogMsgWithTimeout - Send single syslog msg with timeout
Types ¶
type CefHeader ¶
type CefHeader struct { Version int DeviceVendor, DeviceProduct, DeviceVersion string DeviceEventClassId string Name string Severity string }
CefHeader CEF header parameters
type SyslogParams ¶
type SyslogParams struct { Level int `json:"level"` // syslog level info/error/fatal Host string `json:"host"` // host to send Port int `json:"port"` // port to send Protocol string `json:"protocol"` // tcp\udp Priority syslog.Priority Tag string `json:"tag"` // syslog tag NeedTls bool TlsConf *tls.Config }
SyslogParams syslog dial params