func GetSyslogMsgDetails(syslogMsg string) (string, string, string, error) {

	re := regexp.MustCompile(`^<([0-9]{1,3})>(.*)`)
	matches := re.FindStringSubmatch(syslogMsg)
	if len(matches) < 3 {
		return "", "", "", errors.New("Could not extract syslog priority from message")
	}
	priorityNum, err := strconv.Atoi(matches[1])
	if err != nil {
		return "", "", "", nil
	}
	severity := int(math.Mod(float64(priorityNum), 8.0))
	facility := (priorityNum - severity) / 8
	return matches[2], SyslogFacilityString[facility], SyslogSeverityString[severity], nil

}
// GetSyslogMsgDetails returns the facility and severity of a valid syslog message
GetSyslogMsgDetails returns the facility and severity of a valid syslog message
// GetSyslogMsgDetails returns the facility and severity of a valid syslog message
func GetSyslogMsgDetails(syslogMsg string) (string, string, string, error) {
	re := regexp.MustCompile(`^<([0-9]{1,3})>(.*)`)
	matches := re.FindStringSubmatch(syslogMsg)
	if len(matches) < 3 {
		return "", "", "", errors.New("Could not extract syslog priority from message")
	}
	priorityNum, err := strconv.Atoi(matches[1])
	if err != nil {
		return "", "", "", nil
	}
	severity := int(math.Mod(float64(priorityNum), 8.0))
	facility := (priorityNum - severity) / 8
	return matches[2], SyslogFacilityString[facility], SyslogSeverityString[severity], nil
}
func GetSyslogMsgDetails ( syslogMsg string ) ( string , string , string , error ) { re := regexp . MustCompile ( `^<([0-9]{1,3})>(.*)` ) matches := re . FindStringSubmatch ( syslogMsg ) if len ( matches ) < 3 { return " " , " " , " " , errors . New ( " " ) } priorityNum , err := strconv . Atoi ( matches [ 1 ] ) if err != nil { return " " , " " , " " , nil } severity := int ( math . Mod ( float64 ( priorityNum ) , 8.0 ) ) facility := ( priorityNum - severity ) / 8 return matches [ 2 ] , SyslogFacilityString [ facility ] , SyslogSeverityString [ severity ] , nil }
GetSyslogMsgDetails returns the facility and severity of a valid syslog message
GetSyslogMsgDetails returns the facility and severity of a valid syslog message