@@ -64,9 +64,14 @@ type KafkaPluginConfig struct {
6464 Timeout time.Duration `yaml:"timeout,omitempty"`
6565}
6666
67+ type AgentPluginConfig struct {
68+ SocketPath string `yaml:"socketPath"`
69+ }
70+
6771type PluginsConfig struct {
6872 S3 * S3PluginConfig
6973 Kafka * KafkaPluginConfig
74+ Agent * AgentPluginConfig
7075}
7176
7277type OutputConfig struct {
@@ -75,6 +80,10 @@ type OutputConfig struct {
7580 Plugins * PluginsConfig
7681}
7782
83+ type AgentOutputRawConfig struct {
84+ SocketPath string `yaml:"socketPath"`
85+ }
86+
7887type S3OutputRawConfig struct {
7988 Bucket string
8089 Region string
@@ -97,6 +106,7 @@ type KafkaOutputRawConfig struct {
97106type PluginsRawConfig struct {
98107 S3 * S3OutputRawConfig
99108 Kafka * KafkaOutputRawConfig
109+ Agent * AgentOutputRawConfig
100110}
101111
102112type OutputRawConfig struct {
@@ -166,6 +176,7 @@ func NewConfig(configFileName string) (*Config, error) {
166176
167177 var s3Config * S3PluginConfig
168178 var kafkaConfig * KafkaPluginConfig
179+ var agentConfig * AgentPluginConfig
169180 if rawConfig .Output != nil && rawConfig .Output .Plugins != nil {
170181
171182 s3Config , err = populateS3Config (rawConfig )
@@ -179,6 +190,12 @@ func NewConfig(configFileName string) (*Config, error) {
179190 if err != nil {
180191 return nil , err
181192 }
193+
194+ agentConfig , err = populateAgentConfig (rawConfig )
195+
196+ if err != nil {
197+ return nil , err
198+ }
182199 }
183200
184201 compressBlockSize := 65
@@ -213,6 +230,7 @@ func NewConfig(configFileName string) (*Config, error) {
213230 Plugins : & PluginsConfig {
214231 S3 : s3Config ,
215232 Kafka : kafkaConfig ,
233+ Agent : agentConfig ,
216234 },
217235 },
218236 TLS : rawConfig .TLS ,
@@ -303,6 +321,16 @@ func populateKafkaConfig(rawConfig RawConfig) (*KafkaPluginConfig, error) {
303321 }, nil
304322}
305323
324+ func populateAgentConfig (rawConfig RawConfig ) (* AgentPluginConfig , error ) {
325+ if rawConfig .Output .Plugins .Agent == nil {
326+ return nil , nil
327+ }
328+
329+ return & AgentPluginConfig {
330+ SocketPath : rawConfig .Output .Plugins .Agent .SocketPath ,
331+ }, nil
332+ }
333+
306334func populateS3Config (rawConfig RawConfig ) (* S3PluginConfig , error ) {
307335 if rawConfig .Output .Plugins .S3 == nil {
308336 return nil , nil
0 commit comments