diff --git a/go.mod b/go.mod index 0a2dd1ce25..7b704d761a 100644 --- a/go.mod +++ b/go.mod @@ -33,6 +33,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.114.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.114.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tcplogreceiver v0.114.0 github.com/open-telemetry/opentelemetry-collector-contrib/testbed v0.114.0 github.com/shirou/gopsutil/v4 v4.24.10 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index adda7ce6c5..140d745bc8 100644 --- a/go.sum +++ b/go.sum @@ -474,6 +474,8 @@ github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusrec github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0/go.mod h1:T1p6ShTr8farkE4qUB2TyGUIvRSN3s17D0qY7rMqCRM= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.114.0 h1:chiIs7XGNSoptd0VgVR912NFogB8srpuVzgeVM9xW0w= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.114.0/go.mod h1:cHIBJ01AgmkTUN2FgXz9NU8LbnLGUR2uxssCdiqwV4w= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tcplogreceiver v0.114.0 h1:C1487YIMVBuJ8ixBLChyIl8VHlF8Ir6l2hfeYNNPPLM= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tcplogreceiver v0.114.0/go.mod h1:+SvBS7Xu+pI67e5outljqWDMt+bIu9B6XON0nM4PIhY= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.114.0 h1:E686MeQcQ+a3Q47A/xAc3Nk6Qdz8wHcBLMJ3Y8bNKi0= github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.114.0/go.mod h1:zkQAapuNRobj7GY8kKRal+2EYkAMWmZ1KMysUrQI48A= github.com/open-telemetry/opentelemetry-collector-contrib/testbed v0.114.0 h1:/4hKXCQaD78y6cFA4xXMfZhh86/RNwrjyr6xnhFs5AA= diff --git a/internal/collector/factories.go b/internal/collector/factories.go index 92fa823ccc..b7bb0d93e3 100644 --- a/internal/collector/factories.go +++ b/internal/collector/factories.go @@ -20,6 +20,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tcplogreceiver" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/exporter" @@ -98,6 +99,7 @@ func createReceiverFactories() (map[component.Type]receiver.Factory, error) { hostmetricsreceiver.NewFactory(), nginxreceiver.NewFactory(), nginxplusreceiver.NewFactory(), + tcplogreceiver.NewFactory(), } return receiver.MakeFactoryMap(receiverList...) diff --git a/internal/collector/factories_test.go b/internal/collector/factories_test.go index 339c99af62..140a5f873c 100644 --- a/internal/collector/factories_test.go +++ b/internal/collector/factories_test.go @@ -18,7 +18,7 @@ func TestOTelComponentFactoriesDefault(t *testing.T) { require.NoError(t, err, "OTelComponentFactories should not return an error") assert.NotNil(t, factories, "factories should not be nil") - assert.Len(t, factories.Receivers, 4) + assert.Len(t, factories.Receivers, 5) assert.Len(t, factories.Processors, 8) assert.Len(t, factories.Exporters, 4) assert.Len(t, factories.Extensions, 3) diff --git a/internal/collector/otel_collector_plugin.go b/internal/collector/otel_collector_plugin.go index e91fbcee5e..85daaa94d0 100644 --- a/internal/collector/otel_collector_plugin.go +++ b/internal/collector/otel_collector_plugin.go @@ -26,6 +26,16 @@ import ( const ( maxTimeToWaitForShutdown = 30 * time.Second filePermission = 0o600 + // To conform to the rfc3164 spec the timestamp in the logs need to be formatted correctly. + // Here are some examples of what the timestamp conversions look like. + // Notice how if the day begins with a zero that the zero is replaced with an empty space. + + // 2024-11-06T17:19:24+00:00 ---> Nov 6 17:19:24 + // 2024-11-16T17:19:24+00:00 ---> Nov 16 17:19:24 + timestampConversionExpression = `'EXPR(let timestamp = split(split(body, ">")[1], " ")[0]; ` + + `let newTimestamp = timestamp matches "(\\d{4})-(\\d{2})-(0\\d{1})T(\\d{2}):(\\d{2}):(\\d{2}).*" ` + + `? date(timestamp).Format("Jan 2 15:04:05") : date(timestamp).Format("Jan 02 15:04:05"); ` + + `split(body, ">")[0] + ">" + newTimestamp + " " + split(body, " ", 2)[1])'` ) type ( @@ -243,7 +253,7 @@ func (oc *Collector) handleNginxConfigUpdate(ctx context.Context, msg *bus.Messa return } - reloadCollector := oc.checkForNewNginxReceivers(nginxConfigContext) + reloadCollector := oc.checkForNewReceivers(nginxConfigContext) if reloadCollector { slog.InfoContext(ctx, "Reloading OTel collector config") @@ -368,7 +378,7 @@ func (oc *Collector) restartCollector(ctx context.Context) { } } -func (oc *Collector) checkForNewNginxReceivers(nginxConfigContext *model.NginxConfigContext) bool { +func (oc *Collector) checkForNewReceivers(nginxConfigContext *model.NginxConfigContext) bool { nginxReceiverFound, reloadCollector := oc.updateExistingNginxPlusReceiver(nginxConfigContext) if !nginxReceiverFound && nginxConfigContext.PlusAPI.URL != "" { @@ -406,6 +416,11 @@ func (oc *Collector) checkForNewNginxReceivers(nginxConfigContext *model.NginxCo } } + tcplogReceiversFound := oc.updateTcplogReceivers(nginxConfigContext) + if tcplogReceiversFound { + reloadCollector = true + } + return reloadCollector } @@ -476,6 +491,67 @@ func (oc *Collector) updateExistingNginxOSSReceiver( return nginxReceiverFound, reloadCollector } +func (oc *Collector) updateTcplogReceivers(nginxConfigContext *model.NginxConfigContext) bool { + newTcplogReceiverAdded := false + if nginxConfigContext.NAPSysLogServers != nil { + napLoop: + for _, napSysLogServer := range nginxConfigContext.NAPSysLogServers { + if oc.doesTcplogReceiverAlreadyExist(napSysLogServer) { + continue napLoop + } + + oc.config.Collector.Receivers.TcplogReceivers = append( + oc.config.Collector.Receivers.TcplogReceivers, + config.TcplogReceiver{ + ListenAddress: napSysLogServer, + Operators: []config.Operator{ + { + Type: "add", + Fields: map[string]string{ + "field": "body", + "value": timestampConversionExpression, + }, + }, + { + Type: "syslog_parser", + Fields: map[string]string{ + "protocol": "rfc3164", + }, + }, + { + Type: "remove", + Fields: map[string]string{ + "field": "attributes.message", + }, + }, + { + Type: "add", + Fields: map[string]string{ + "field": "resource[\"instance.id\"]", + "value": nginxConfigContext.InstanceID, + }, + }, + }, + }, + ) + + newTcplogReceiverAdded = true + } + } + + return newTcplogReceiverAdded +} + +func (oc *Collector) doesTcplogReceiverAlreadyExist(listenAddress string) bool { + for _, tcplogReceiver := range oc.config.Collector.Receivers.TcplogReceivers { + if listenAddress == tcplogReceiver.ListenAddress { + return true + } + } + + return false +} + // nolint: revive func (oc *Collector) updateResourceAttributes( attributesToAdd []config.ResourceAttribute, diff --git a/internal/collector/otel_collector_plugin_test.go b/internal/collector/otel_collector_plugin_test.go index cbe0c808a1..b948e7e06f 100644 --- a/internal/collector/otel_collector_plugin_test.go +++ b/internal/collector/otel_collector_plugin_test.go @@ -9,6 +9,7 @@ import ( "context" "errors" "fmt" + "path/filepath" "testing" "github.com/nginx/agent/v3/test/protos" @@ -26,6 +27,8 @@ import ( ) func TestCollector_New(t *testing.T) { + tmpDir := t.TempDir() + tests := []struct { config *config.Config expectedError error @@ -56,7 +59,7 @@ func TestCollector_New(t *testing.T) { name: "Successful initialization", config: &config.Config{ Collector: &config.Collector{ - Log: &config.Log{Path: "/tmp/test.log"}, + Log: &config.Log{Path: filepath.Join(tmpDir, "test.log")}, }, }, expectedError: nil, @@ -79,6 +82,8 @@ func TestCollector_New(t *testing.T) { } func TestCollector_Init(t *testing.T) { + tmpDir := t.TempDir() + tests := []struct { name string expectedLog string @@ -104,7 +109,7 @@ func TestCollector_Init(t *testing.T) { logBuf := &bytes.Buffer{} stub.StubLoggerWith(logBuf) - conf.Collector.Log = &config.Log{Path: "/tmp/test.log"} + conf.Collector.Log = &config.Log{Path: filepath.Join(tmpDir, "test.log")} if tt.expectedError { conf.Collector.Receivers = config.Receivers{} @@ -714,6 +719,44 @@ func TestCollector_updateResourceAttributes(t *testing.T) { } } +func TestCollector_updateTcplogReceivers(t *testing.T) { + conf := types.OTelConfig(t) + conf.Collector.Log.Path = "" + conf.Collector.Processors.Batch = nil + conf.Collector.Processors.Attribute = nil + conf.Collector.Processors.Resource = nil + + collector, err := New(conf) + require.NoError(t, err) + + nginxConfigContext := &model.NginxConfigContext{ + NAPSysLogServers: []string{ + "localhost:151", + }, + } + + assert.Empty(t, conf.Collector.Receivers.TcplogReceivers) + + t.Run("Test 1: New TcplogReceiver added", func(tt *testing.T) { + tcplogReceiverAdded := collector.updateTcplogReceivers(nginxConfigContext) + + assert.True(tt, tcplogReceiverAdded) + assert.Len(tt, conf.Collector.Receivers.TcplogReceivers, 1) + assert.Equal(tt, "localhost:151", conf.Collector.Receivers.TcplogReceivers[0].ListenAddress) + assert.Len(tt, conf.Collector.Receivers.TcplogReceivers[0].Operators, 4) + }) + + // Calling updateTcplogReceivers shouldn't update the TcplogReceivers slice + // since there is already a receiver with the same ListenAddress + t.Run("Test 2: TcplogReceiver already exists", func(tt *testing.T) { + tcplogReceiverAdded := collector.updateTcplogReceivers(nginxConfigContext) + assert.False(t, tcplogReceiverAdded) + assert.Len(t, conf.Collector.Receivers.TcplogReceivers, 1) + assert.Equal(t, "localhost:151", conf.Collector.Receivers.TcplogReceivers[0].ListenAddress) + assert.Len(t, conf.Collector.Receivers.TcplogReceivers[0].Operators, 4) + }) +} + func createFakeCollector() *typesfakes.FakeCollectorInterface { fakeCollector := &typesfakes.FakeCollectorInterface{} fakeCollector.RunStub = func(ctx context.Context) error { return nil } diff --git a/internal/collector/otelcol.tmpl b/internal/collector/otelcol.tmpl index e91f11eb8d..d92d2b18e4 100644 --- a/internal/collector/otelcol.tmpl +++ b/internal/collector/otelcol.tmpl @@ -80,6 +80,17 @@ receivers: location: "{{- .PlusAPI.Location -}}" collection_interval: 10s {{- end }} +{{- range $index, $tcplogReceiver := .Receivers.TcplogReceivers }} + tcplog/{{$index}}: + listen_address: "{{- .ListenAddress -}}" + operators: +{{- range $index, $operator := .Operators }} + - type: {{.Type}} +{{- range $key, $value := .Fields }} + {{$key}}: {{$value}} +{{- end }} +{{- end }} +{{- end }} processors: {{- if ne .Processors.Resource nil }} @@ -241,3 +252,26 @@ service: {{- if ne .Exporters.Debug nil }} - debug {{- end }} + {{- if ne .Receivers.TcplogReceivers nil }} + logs: + receivers: + {{- range $index, $tcplogReceiver := .Receivers.TcplogReceivers }} + - tcplog/{{$index}} + {{- end }} + processors: + {{- if ne .Processors.Resource nil }} + {{- if .Processors.Resource.Attributes }} + - resource + {{- end }} + {{- end }} + {{- if ne .Processors.Batch nil }} + - batch + {{- end }} + exporters: + {{- range $index, $otlpExporter := .Exporters.OtlpExporters }} + - otlp/{{$index}} + {{- end }} + {{- if ne .Exporters.Debug nil }} + - debug + {{- end }} + {{- end }} diff --git a/internal/collector/settings_test.go b/internal/collector/settings_test.go index e7946d7ff0..3d10890c7f 100644 --- a/internal/collector/settings_test.go +++ b/internal/collector/settings_test.go @@ -49,9 +49,20 @@ func TestConfigProviderSettings(t *testing.T) { } func TestTemplateWrite(t *testing.T) { + tmpDir := t.TempDir() + cfg := types.AgentConfig() - actualConfPath := filepath.Join("/tmp/", "nginx-agent-otelcol-test.yaml") + actualConfPath := filepath.Join(tmpDir, "nginx-agent-otelcol-test.yaml") cfg.Collector.ConfigPath = actualConfPath + cfg.Collector.Processors.Resource = &config.Resource{ + Attributes: []config.ResourceAttribute{ + { + Key: "resource.id", + Action: "add", + Value: "12345", + }, + }, + } cfg.Collector.Exporters.PrometheusExporter = &config.PrometheusExporter{ Server: &config.ServerConfig{ @@ -104,6 +115,27 @@ func TestTemplateWrite(t *testing.T) { }, }) + cfg.Collector.Receivers.TcplogReceivers = []config.TcplogReceiver{ + { + ListenAddress: "localhost:151", + Operators: []config.Operator{ + { + Type: "add", + Fields: map[string]string{ + "field": "body", + "value": `EXPR(split(body, ",")[0])`, + }, + }, + { + Type: "remove", + Fields: map[string]string{ + "field": "attributes.message", + }, + }, + }, + }, + } + cfg.Collector.Extensions.HeadersSetter = &config.HeadersSetter{ Headers: []config.Header{ { diff --git a/internal/config/defaults.go b/internal/config/defaults.go index 526ea914c9..1716320b34 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -63,14 +63,6 @@ const ( DefCollectorExtensionsHealthTLSCAPath = "" DefCollectorExtensionsHealthTLSSkipVerify = false DefCollectorExtensionsHealthTLServerNameKey = "" - - DefCollectorPrometheusExporterServerHost = "" - DefCollectorPrometheusExporterServerPort = 0 - DefCollectorPrometheusExporterTLSCertPath = "" - DefCollectorPrometheusExporterTLSKeyPath = "" - DefCollectorPrometheusExporterTLSCAPath = "" - DefCollectorPrometheusExporterTLSSkipVerify = false - DefCollectorPrometheusExporterTLServerNameKey = "" ) func DefaultFeatures() []string { diff --git a/internal/config/types.go b/internal/config/types.go index f532dad376..377ccd88da 100644 --- a/internal/config/types.go +++ b/internal/config/types.go @@ -164,6 +164,7 @@ type ( OtlpReceivers []OtlpReceiver `yaml:"-" mapstructure:"otlp_receivers"` NginxReceivers []NginxReceiver `yaml:"-" mapstructure:"nginx_receivers"` NginxPlusReceivers []NginxPlusReceiver `yaml:"-" mapstructure:"nginx_plus_receivers"` + TcplogReceivers []TcplogReceiver `yaml:"-" mapstructure:"tcplog_receivers"` } OtlpReceiver struct { @@ -172,6 +173,19 @@ type ( OtlpTLSConfig *OtlpTLSConfig `yaml:"-" mapstructure:"tls"` } + TcplogReceiver struct { + ListenAddress string `yaml:"-" mapstructure:"listen_address"` + Operators []Operator `yaml:"-" mapstructure:"operators"` + } + + // There are many types of operators with different field names so we use a generic map to store the fields. + // See here for more info: + // https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/docs/operators/README.md + Operator struct { + Fields map[string]string `yaml:"-" mapstructure:"fields"` + Type string `yaml:"-" mapstructure:"type"` + } + NginxReceiver struct { InstanceID string `yaml:"-" mapstructure:"instance_id"` StubStatus APIDetails `yaml:"-" mapstructure:"api_details"` diff --git a/internal/model/config.go b/internal/model/config.go index 15f0bbfbdb..8307940283 100644 --- a/internal/model/config.go +++ b/internal/model/config.go @@ -12,12 +12,13 @@ import ( ) type NginxConfigContext struct { - StubStatus *APIDetails - PlusAPI *APIDetails - InstanceID string - Files []*v1.File - AccessLogs []*AccessLog - ErrorLogs []*ErrorLog + StubStatus *APIDetails + PlusAPI *APIDetails + InstanceID string + Files []*v1.File + AccessLogs []*AccessLog + ErrorLogs []*ErrorLog + NAPSysLogServers []string } type APIDetails struct { @@ -57,6 +58,10 @@ func (ncc *NginxConfigContext) Equal(otherNginxConfigContext *NginxConfigContext return false } + if !reflect.DeepEqual(ncc.NAPSysLogServers, otherNginxConfigContext.NAPSysLogServers) { + return false + } + return true } diff --git a/internal/watcher/instance/nginx_config_parser.go b/internal/watcher/instance/nginx_config_parser.go index 34beb8a97c..5ca41c4995 100644 --- a/internal/watcher/instance/nginx_config_parser.go +++ b/internal/watcher/instance/nginx_config_parser.go @@ -16,6 +16,7 @@ import ( "net/http" "os" "path/filepath" + "regexp" "slices" "strconv" "strings" @@ -93,6 +94,8 @@ func (ncp *NginxConfigParser) createNginxConfigContext( instance *mpi.Instance, payload *crossplane.Payload, ) (*model.NginxConfigContext, error) { + napSyslogServersFound := make(map[string]bool) + nginxConfigContext := &model.NginxConfigContext{ InstanceID: instance.GetInstanceMeta().GetInstanceId(), PlusAPI: &model.APIDetails{ @@ -133,6 +136,23 @@ func (ncp *NginxConfigParser) createNginxConfigContext( case "ssl_certificate", "proxy_ssl_certificate", "ssl_client_certificate", "ssl_trusted_certificate": sslCertFile := ncp.sslCert(ctx, directive.Args[0], rootDir) nginxConfigContext.Files = append(nginxConfigContext.Files, sslCertFile) + case "app_protect_security_log": + if len(directive.Args) > 1 { + syslogArg := directive.Args[1] + re := regexp.MustCompile(`syslog:server=([\S]+)`) + matches := re.FindStringSubmatch(syslogArg) + if len(matches) > 1 { + syslogServer := matches[1] + if !napSyslogServersFound[syslogServer] { + nginxConfigContext.NAPSysLogServers = append( + nginxConfigContext.NAPSysLogServers, + syslogServer, + ) + napSyslogServersFound[syslogServer] = true + slog.DebugContext(ctx, "Found NAP syslog server", "address", syslogServer) + } + } + } } return nil diff --git a/internal/watcher/instance/nginx_config_parser_test.go b/internal/watcher/instance/nginx_config_parser_test.go index b37b4b3cc4..2c5f632d8e 100644 --- a/internal/watcher/instance/nginx_config_parser_test.go +++ b/internal/watcher/instance/nginx_config_parser_test.go @@ -294,16 +294,19 @@ func TestNginxConfigParser_Parse(t *testing.T) { require.NoError(t, err) tests := []struct { - instance *mpi.Instance - name string + instance *mpi.Instance + name string + syslogServers []string }{ { - name: "Test 1: Valid response", - instance: protos.GetNginxOssInstance([]string{}), + name: "Test 1: Valid response", + instance: protos.GetNginxOssInstance([]string{}), + syslogServers: []string{"127.0.0.1:1515"}, }, { - name: "Test 2: Error response", - instance: protos.GetNginxPlusInstance([]string{}), + name: "Test 2: Error response", + instance: protos.GetNginxPlusInstance([]string{}), + syslogServers: []string{"127.0.0.1:1515"}, }, } @@ -315,7 +318,9 @@ func TestNginxConfigParser_Parse(t *testing.T) { ltsvAccessLog.Name(), errorLog.Name(), test.instance.GetInstanceMeta().GetInstanceId(), + test.syslogServers, ) + expectedConfigContext.Files = append(expectedConfigContext.Files, &mpi.File{ FileMeta: fileMeta, }) diff --git a/test/config/collector/test-opentelemetry-collector-agent.yaml b/test/config/collector/test-opentelemetry-collector-agent.yaml index 9b103b67f1..7181cfc68b 100644 --- a/test/config/collector/test-opentelemetry-collector-agent.yaml +++ b/test/config/collector/test-opentelemetry-collector-agent.yaml @@ -25,8 +25,21 @@ receivers: access_logs: - log_format: "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"\"$upstream_cache_status\"" file_path: "/var/log/nginx/access-custom.conf" + tcplog/0: + listen_address: "localhost:151" + operators: + - type: add + field: body + value: EXPR(split(body, ",")[0]) + - type: remove + field: attributes.message processors: + resource: + attributes: + - key: resource.id + action: add + value: 12345 batch: send_batch_size: 8192 timeout: 200ms @@ -82,8 +95,18 @@ service: - otlp/0 - nginx/123 processors: + - resource - batch exporters: - otlp/0 - prometheus - debug + logs: + receivers: + - tcplog/0 + processors: + - resource + - batch + exporters: + - otlp/0 + - debug diff --git a/test/config/nginx/nginx-with-multiple-access-logs.conf b/test/config/nginx/nginx-with-multiple-access-logs.conf index 83582169a6..4d22a456e9 100644 --- a/test/config/nginx/nginx-with-multiple-access-logs.conf +++ b/test/config/nginx/nginx-with-multiple-access-logs.conf @@ -4,6 +4,7 @@ worker_processes auto; error_log %s notice; pid /var/run/nginx.pid; +load_module modules/ngx_http_app_protect_module.so; events { worker_connections 1024; @@ -33,5 +34,7 @@ http { server { access_log %s ltsv; + + app_protect_security_log "/etc/app_protect/conf/log_default.json" syslog:server=127.0.0.1:1515; } } diff --git a/test/mock/collector/otel-collector.yaml b/test/mock/collector/otel-collector.yaml index 1fb86a2560..b1e801a9cc 100644 --- a/test/mock/collector/otel-collector.yaml +++ b/test/mock/collector/otel-collector.yaml @@ -11,6 +11,10 @@ exporters: resource_to_telemetry_conversion: enabled: true add_metric_suffixes: false + debug: + verbosity: detailed + sampling_initial: 5 + sampling_thereafter: 200 processors: batch: @@ -28,3 +32,7 @@ service: receivers: [otlp] processors: [batch] exporters: [prometheus] + logs: + receivers: [otlp] + processors: [batch] + exporters: [debug] diff --git a/test/model/config.go b/test/model/config.go index e20759e7db..6aca42b449 100644 --- a/test/model/config.go +++ b/test/model/config.go @@ -19,12 +19,14 @@ func GetConfigContext() *model.NginxConfigContext { } } +// nolint: revive func GetConfigContextWithNames( accessLogName, combinedAccessLogName, ltsvAccessLogName, errorLogName string, instanceID string, + syslogServers []string, ) *model.NginxConfigContext { return &model.NginxConfigContext{ StubStatus: &model.APIDetails{ @@ -61,6 +63,7 @@ func GetConfigContextWithNames( Permissions: "0600", }, }, - InstanceID: instanceID, + InstanceID: instanceID, + NAPSysLogServers: syslogServers, } }