Пример #1
0
func (bc *BeatsConfig) String() string {
	if bc.Container != nil {
		if bytes, err := yaml.Marshal(bc.Container); err == nil {
			return string(common.ConvertLineBreak(bytes))
		}
	}
	return "---"
}
Пример #2
0
func (nxc *NxConfig) Render() []byte {
	var result bytes.Buffer
	result.WriteString(nxc.definitionsToString())
	result.WriteString(nxc.pathsToString())
	result.WriteString(nxc.extensionsToString())
	result.WriteString(nxc.snippetsToString())
	result.WriteString(nxc.inputsToString())
	result.WriteString(nxc.outputsToString())
	// pre-canned types
	result.WriteString(nxc.fileInputsToString())
	result.WriteString(nxc.windowsEventLogInputsToString())
	result.WriteString(nxc.udpSyslogInputsToString())
	result.WriteString(nxc.tcpSyslogInputsToString())
	result.WriteString(nxc.gelfUdpOutputsToString())
	result.WriteString(nxc.gelfTcpOutputsToString())
	result.WriteString(nxc.gelfTcpTlsOutputsToString())
	//
	result.WriteString(nxc.routesToString())
	result.WriteString(nxc.matchesToString())

	return common.ConvertLineBreak(result.Bytes())
}