diff --git a/apps/oracledb.go b/apps/oracledb.go index dc621af9d9..1e29ab5c84 100644 --- a/apps/oracledb.go +++ b/apps/oracledb.go @@ -23,7 +23,6 @@ import ( "strings" "github.com/GoogleCloudPlatform/ops-agent/confgenerator" - "github.com/GoogleCloudPlatform/ops-agent/confgenerator/fluentbit" "github.com/GoogleCloudPlatform/ops-agent/confgenerator/otel" "github.com/GoogleCloudPlatform/ops-agent/internal/secret" ) @@ -765,188 +764,184 @@ func init() { confgenerator.MetricsReceiverTypes.RegisterType(func() confgenerator.MetricsReceiver { return &MetricsReceiverOracleDB{} }) } -type LoggingProcessorOracleDBAlert struct { - confgenerator.ConfigComponent `yaml:",inline"` +type LoggingProcessorMacroOracleDBAlert struct { } -func (lr LoggingProcessorOracleDBAlert) Type() string { +func (lr LoggingProcessorMacroOracleDBAlert) Type() string { return "oracledb_alert" } -func (lr LoggingProcessorOracleDBAlert) Components(ctx context.Context, tag string, uid string) []fluentbit.Component { - components := confgenerator.LoggingProcessorParseMultilineRegex{ - LoggingProcessorParseRegexComplex: confgenerator.LoggingProcessorParseRegexComplex{ - Parsers: []confgenerator.RegexParser{ - { - // Sample log: 2021-12-21T10:19:47.339827-05:00 - // Thread 1 opened at log sequence 1 - // Current log# 1 seq# 1 mem# 0: /u01/oracle/oradata/DB19C/redo01.log - // Successful open of redo thread 1 - Regex: `^(?\d+-\d+-\d+T\d+:\d+:\d+.\d+(?:[-+]\d+:\d+|Z))\n(?[\s\S]+)`, - Parser: confgenerator.ParserShared{ - TimeKey: "timestamp", - TimeFormat: "%Y-%m-%dT%H:%M:%S.%L%z", +func (lr LoggingProcessorMacroOracleDBAlert) Expand(ctx context.Context) []confgenerator.InternalLoggingProcessor { + severityVal := "ALERT" + return []confgenerator.InternalLoggingProcessor{ + confgenerator.LoggingProcessorParseMultilineRegex{ + LoggingProcessorParseRegexComplex: confgenerator.LoggingProcessorParseRegexComplex{ + Parsers: []confgenerator.RegexParser{ + { + // Sample log: 2021-12-21T10:19:47.339827-05:00 + // Thread 1 opened at log sequence 1 + // Current log# 1 seq# 1 mem# 0: /u01/oracle/oradata/DB19C/redo01.log + // Successful open of redo thread 1 + Regex: `^(?\d+-\d+-\d+T\d+:\d+:\d+.\d+(?:[-+]\d+:\d+|Z))\n(?[\s\S]+)`, + Parser: confgenerator.ParserShared{ + TimeKey: "timestamp", + TimeFormat: "%Y-%m-%dT%H:%M:%S.%L%z", + }, }, }, }, - }, - Rules: []confgenerator.MultilineRule{ - { - StateName: "start_state", - NextState: "cont", - Regex: `^\d+-\d+-\d+T\d+:\d+:\d+.\d+(?:[-+]\d+:\d+|Z)`, - }, - { - StateName: "cont", - NextState: "cont", - Regex: `^(?!\d+-\d+-\d+T\d+:\d+:\d+.\d+(?:[-+]\d+:\d+|Z)).*$`, + Rules: []confgenerator.MultilineRule{ + { + StateName: "start_state", + NextState: "cont", + Regex: `^\d+-\d+-\d+T\d+:\d+:\d+.\d+(?:[-+]\d+:\d+|Z)`, + }, + { + StateName: "cont", + NextState: "cont", + Regex: `^(?!\d+-\d+-\d+T\d+:\d+:\d+.\d+(?:[-+]\d+:\d+|Z)).*$`, + }, }, }, - }.Components(ctx, tag, uid) - - severityVal := "ALERT" - components = append(components, confgenerator.LoggingProcessorModifyFields{ Fields: map[string]*confgenerator.ModifyField{ "severity": {StaticValue: &severityVal}, InstrumentationSourceLabel: instrumentationSourceValue(lr.Type()), }, - }.Components(ctx, tag, uid)...) - return components + }, + } } -type LoggingReceiverOracleDBAlert struct { - LoggingProcessorOracleDBAlert `yaml:",inline"` - ReceiverMixin confgenerator.LoggingReceiverFilesMixin `yaml:",inline" validate:"structonly"` - OracleHome string `yaml:"oracle_home,omitempty" validate:"required_without=IncludePaths,excluded_with=IncludePaths"` - IncludePaths []string `yaml:"include_paths,omitempty" validate:"required_without=OracleHome,excluded_with=OracleHome"` +type LoggingReceiverMacroOracleDBAlert struct { + OracleHome string `yaml:"oracle_home,omitempty" validate:"required_without=IncludePaths,excluded_with=IncludePaths"` + IncludePaths []string `yaml:"include_paths,omitempty" validate:"required_without=OracleHome,excluded_with=OracleHome"` + confgenerator.LoggingReceiverFilesMixin `yaml:",inline"` + LoggingProcessorMacroOracleDBAlert `yaml:",inline"` } -func (lr LoggingReceiverOracleDBAlert) Components(ctx context.Context, tag string) []fluentbit.Component { +func (lr LoggingReceiverMacroOracleDBAlert) Expand(ctx context.Context) (confgenerator.InternalLoggingReceiver, []confgenerator.InternalLoggingProcessor) { if len(lr.OracleHome) > 0 { lr.IncludePaths = []string{ path.Join(lr.OracleHome, "/diag/rdbms/*/*/trace/alert_*.log"), } } - lr.ReceiverMixin.IncludePaths = lr.IncludePaths + lr.LoggingReceiverFilesMixin.IncludePaths = lr.IncludePaths - c := lr.ReceiverMixin.Components(ctx, tag) - c = append(c, lr.LoggingProcessorOracleDBAlert.Components(ctx, tag, lr.Type())...) - return c + return &lr.LoggingReceiverFilesMixin, lr.LoggingProcessorMacroOracleDBAlert.Expand(ctx) } -type LoggingProcessorOracleDBAudit struct { - confgenerator.ConfigComponent `yaml:",inline"` +type LoggingProcessorMacroOracleDBAudit struct { } -func (lr LoggingProcessorOracleDBAudit) Type() string { +func (lr LoggingProcessorMacroOracleDBAudit) Type() string { return "oracledb_audit" } -func (lr LoggingProcessorOracleDBAudit) Components(ctx context.Context, tag string, uid string) []fluentbit.Component { - components := confgenerator.LoggingProcessorParseMultilineRegex{ - LoggingProcessorParseRegexComplex: confgenerator.LoggingProcessorParseRegexComplex{ - Parsers: []confgenerator.RegexParser{ - { - // Sample log: Wed Sep 14 16:18:03 2022 +00:00 - // LENGTH : '623' - // ACTION :[373] 'select distinct 'ALTER SYSTEM KILL SESSION ''' || stat.sid || ',' || - // sess.serial# || - // decode(substr(inst.version, 1, 4), - // '12.1', ''' immediate ', ''' force timeout 0 ') || - // '-- process 73841' - // FROM SYS.V$mystat stat, v$session sess, v$instance inst - // where stat.sid=sess.sid - // union all - // select '/' from dual' - // DATABASE USER:[1] '/' - // PRIVILEGE :[6] 'SYSDBA' - // CLIENT USER:[6] 'oracle' - // CLIENT TERMINAL:[5] 'pts/1' - // STATUS:[1] '0' - // DBID:[10] '1643176521' - // SESSIONID:[10] '4294967295' - // USERHOST:[7] 'oradb19' - // CLIENT ADDRESS:[0] '' - // ACTION NUMBER:[1] '3' - Regex: `^(?\w+\s+\w+\s+\d+\s+\d+:\d+:\d+\s+\d+\s+(?:[-+]\d+:\d+|Z))\n` + - `LENGTH\s*:(?:\[\d*\])?\s*'(?.*)'\n` + - `ACTION\s*:(?:\[\d*\])?\s*'(?[\s\S]*)'\n` + - `DATABASE USER\s*:(?:\[\d*\])?\s*'(?.*)'\n` + - `PRIVILEGE\s*:(?:\[\d*\])?\s*'(?.*)'\n` + - `CLIENT USER\s*:(?:\[\d*\])?\s*'(?.*)'\n` + - `CLIENT TERMINAL\s*:(?:\[\d*\])?\s*'(?.*)'\n` + - `STATUS\s*:(?:\[\d*\])?\s*'(?.*)'\n` + - `DBID\s*:(?:\[\d*\])?\s*'(?.*)'\n` + - `SESSIONID\s*:(?:\[\d*\])?\s*'(?.*)'\n` + - `USERHOST\s*:(?:\[\d*\])?\s*'(?.*)'\n` + - `CLIENT ADDRESS\s*:(?:\[\d*\])?\s*'(?.*)'\n` + - `ACTION NUMBER\s*:(?:\[\d*\])?\s*'(?.*)'\n?`, - Parser: confgenerator.ParserShared{ - TimeKey: "timestamp", - TimeFormat: "%a %b %d %H:%M:%S %Y %z", - Types: map[string]string{ - "length": "int", - "action_number": "int", - "dbid": "int", - "sessionid": "int", - "status": "int", +func (lr LoggingProcessorMacroOracleDBAudit) Expand(ctx context.Context) []confgenerator.InternalLoggingProcessor { + severityVal := "INFO" + return []confgenerator.InternalLoggingProcessor{ + confgenerator.LoggingProcessorParseMultilineRegex{ + LoggingProcessorParseRegexComplex: confgenerator.LoggingProcessorParseRegexComplex{ + Parsers: []confgenerator.RegexParser{ + { + // Sample log: Wed Sep 14 16:18:03 2022 +00:00 + // LENGTH : '623' + // ACTION :[373] 'select distinct 'ALTER SYSTEM KILL SESSION ''' || stat.sid || ',' || + // sess.serial# || + // decode(substr(inst.version, 1, 4), + // '12.1', ''' immediate ', ''' force timeout 0 ') || + // '-- process 73841' + // FROM SYS.V$mystat stat, v$session sess, v$instance inst + // where stat.sid=sess.sid + // union all + // select '/' from dual' + // DATABASE USER:[1] '/' + // PRIVILEGE :[6] 'SYSDBA' + // CLIENT USER:[6] 'oracle' + // CLIENT TERMINAL:[5] 'pts/1' + // STATUS:[1] '0' + // DBID:[10] '1643176521' + // SESSIONID:[10] '4294967295' + // USERHOST:[7] 'oradb19' + // CLIENT ADDRESS:[0] '' + // ACTION NUMBER:[1] '3' + Regex: `^(?\w+\s+\w+\s+\d+\s+\d+:\d+:\d+\s+\d+\s+(?:[-+]\d+:\d+|Z))\n` + + `LENGTH\s*:(?:\[\d*\])?\s*'(?.*)'\n` + + `ACTION\s*:(?:\[\d*\])?\s*'(?[\s\S]*)'\n` + + `DATABASE USER\s*:(?:\[\d*\])?\s*'(?.*)'\n` + + `PRIVILEGE\s*:(?:\[\d*\])?\s*'(?.*)'\n` + + `CLIENT USER\s*:(?:\[\d*\])?\s*'(?.*)'\n` + + `CLIENT TERMINAL\s*:(?:\[\d*\])?\s*'(?.*)'\n` + + `STATUS\s*:(?:\[\d*\])?\s*'(?.*)'\n` + + `DBID\s*:(?:\[\d*\])?\s*'(?.*)'\n` + + `SESSIONID\s*:(?:\[\d*\])?\s*'(?.*)'\n` + + `USERHOST\s*:(?:\[\d*\])?\s*'(?.*)'\n` + + `CLIENT ADDRESS\s*:(?:\[\d*\])?\s*'(?.*)'\n` + + `ACTION NUMBER\s*:(?:\[\d*\])?\s*'(?.*)'\n?`, + Parser: confgenerator.ParserShared{ + TimeKey: "timestamp", + TimeFormat: "%a %b %d %H:%M:%S %Y %z", + Types: map[string]string{ + "length": "int", + "action_number": "int", + "dbid": "int", + "sessionid": "int", + "status": "int", + }, }, }, }, }, - }, - Rules: []confgenerator.MultilineRule{ - { - StateName: "start_state", - NextState: "cont", - Regex: `^\w+ \w+ {1,2}\d+ {1,2}\d+:\d+:\d+ \d+ (?:[-+]\d+:\d+|Z)`, - }, - { - StateName: "cont", - NextState: "cont", - Regex: `^(?!\w+ \w+ {1,2}\d+ {1,2}\d+:\d+:\d+ \d+ (?:[-+]\d+:\d+|Z)).*$`, + Rules: []confgenerator.MultilineRule{ + { + StateName: "start_state", + NextState: "cont", + Regex: `^\w+ \w+ {1,2}\d+ {1,2}\d+:\d+:\d+ \d+ (?:[-+]\d+:\d+|Z)`, + }, + { + StateName: "cont", + NextState: "cont", + Regex: `^(?!\w+ \w+ {1,2}\d+ {1,2}\d+:\d+:\d+ \d+ (?:[-+]\d+:\d+|Z)).*$`, + }, }, }, - }.Components(ctx, tag, uid) - - severityVal := "INFO" - - components = append(components, confgenerator.LoggingProcessorModifyFields{ Fields: map[string]*confgenerator.ModifyField{ "severity": {StaticValue: &severityVal}, InstrumentationSourceLabel: instrumentationSourceValue(lr.Type()), }, - }.Components(ctx, tag, uid)...) - return components + }, + } } -type LoggingReceiverOracleDBAudit struct { - LoggingProcessorOracleDBAudit `yaml:",inline"` - ReceiverMixin confgenerator.LoggingReceiverFilesMixin `yaml:",inline" validate:"structonly"` - OracleHome string `yaml:"oracle_home,omitempty" validate:"required_without=IncludePaths,excluded_with=IncludePaths"` - IncludePaths []string `yaml:"include_paths,omitempty" validate:"required_without=OracleHome,excluded_with=OracleHome"` +type LoggingReceiverMacroOracleDBAudit struct { + OracleHome string `yaml:"oracle_home,omitempty" validate:"required_without=IncludePaths,excluded_with=IncludePaths"` + IncludePaths []string `yaml:"include_paths,omitempty" validate:"required_without=OracleHome,excluded_with=OracleHome"` + confgenerator.LoggingReceiverFilesMixin `yaml:",inline"` + LoggingProcessorMacroOracleDBAudit `yaml:",inline"` } -func (lr LoggingReceiverOracleDBAudit) Components(ctx context.Context, tag string) []fluentbit.Component { +func (lr LoggingReceiverMacroOracleDBAudit) Expand(ctx context.Context) (confgenerator.InternalLoggingReceiver, []confgenerator.InternalLoggingProcessor) { if len(lr.OracleHome) > 0 { lr.IncludePaths = []string{ path.Join(lr.OracleHome, "/admin/*/adump/*.aud"), } } - lr.ReceiverMixin.IncludePaths = lr.IncludePaths + lr.LoggingReceiverFilesMixin.IncludePaths = lr.IncludePaths - c := lr.ReceiverMixin.Components(ctx, tag) - c = append(c, lr.LoggingProcessorOracleDBAudit.Components(ctx, tag, lr.Type())...) - return c + return &lr.LoggingReceiverFilesMixin, lr.LoggingProcessorMacroOracleDBAudit.Expand(ctx) } func init() { - confgenerator.LoggingReceiverTypes.RegisterType(func() confgenerator.LoggingReceiver { return &LoggingReceiverOracleDBAlert{} }) - confgenerator.LoggingProcessorTypes.RegisterType(func() confgenerator.LoggingProcessor { return &LoggingProcessorOracleDBAlert{} }) - confgenerator.LoggingReceiverTypes.RegisterType(func() confgenerator.LoggingReceiver { return &LoggingReceiverOracleDBAudit{} }) - confgenerator.LoggingProcessorTypes.RegisterType(func() confgenerator.LoggingProcessor { return &LoggingProcessorOracleDBAudit{} }) + confgenerator.RegisterLoggingProcessorMacro[LoggingProcessorMacroOracleDBAlert]() + confgenerator.RegisterLoggingReceiverMacro[LoggingReceiverMacroOracleDBAlert](func() LoggingReceiverMacroOracleDBAlert { + return LoggingReceiverMacroOracleDBAlert{} + }) + confgenerator.RegisterLoggingProcessorMacro[LoggingProcessorMacroOracleDBAudit]() + confgenerator.RegisterLoggingReceiverMacro[LoggingReceiverMacroOracleDBAudit](func() LoggingReceiverMacroOracleDBAudit { + return LoggingReceiverMacroOracleDBAudit{} + }) + } diff --git a/apps/vault.go b/apps/vault.go index e9a7459487..7871a7b102 100644 --- a/apps/vault.go +++ b/apps/vault.go @@ -19,7 +19,6 @@ import ( "fmt" "github.com/GoogleCloudPlatform/ops-agent/confgenerator" - "github.com/GoogleCloudPlatform/ops-agent/confgenerator/fluentbit" "github.com/GoogleCloudPlatform/ops-agent/confgenerator/otel" "github.com/GoogleCloudPlatform/ops-agent/internal/secret" ) @@ -307,44 +306,38 @@ func init() { confgenerator.MetricsReceiverTypes.RegisterType(func() confgenerator.MetricsReceiver { return &MetricsReceiverVault{} }) } -type LoggingProcessorVaultJson struct { - confgenerator.ConfigComponent `yaml:",inline"` +type LoggingProcessorMacroVaultJson struct { } -func (LoggingProcessorVaultJson) Type() string { +func (LoggingProcessorMacroVaultJson) Type() string { return "vault_audit" } -func (p LoggingProcessorVaultJson) Components(ctx context.Context, tag, uid string) []fluentbit.Component { - c := []fluentbit.Component{} - - // sample log line: - // {"time":"2022-06-07T20:34:34.392078404Z","type":"request","auth":{"token_type":"default"},"request":{"id":"aa005196-0280-381d-ebeb-1a083bdf5675","operation":"update","namespace":{"id":"root"},"path":"sys/audit/test"}} - jsonParser := &confgenerator.LoggingProcessorParseJson{ - ParserShared: confgenerator.ParserShared{ - TimeKey: "time", - TimeFormat: "%Y-%m-%dT%H:%M:%S.%L%z", - }, - } - - c = append(c, +func (p LoggingProcessorMacroVaultJson) Expand(ctx context.Context) []confgenerator.InternalLoggingProcessor { + return []confgenerator.InternalLoggingProcessor{ confgenerator.LoggingProcessorModifyFields{ Fields: map[string]*confgenerator.ModifyField{ InstrumentationSourceLabel: instrumentationSourceValue(p.Type()), }, - }.Components(ctx, tag, uid)..., - ) - c = append(c, jsonParser.Components(ctx, tag, uid)...) - return c + }, + // sample log line: + // {"time":"2022-06-07T20:34:34.392078404Z","type":"request","auth":{"token_type":"default"},"request":{"id":"aa005196-0280-381d-ebeb-1a083bdf5675","operation":"update","namespace":{"id":"root"},"path":"sys/audit/test"}} + confgenerator.LoggingProcessorParseJson{ + ParserShared: confgenerator.ParserShared{ + TimeKey: "time", + TimeFormat: "%Y-%m-%dT%H:%M:%S.%L%z", + }, + }, + } } -type LoggingReceiverVaultAuditJson struct { - LoggingProcessorVaultJson `yaml:",inline"` - ReceiverMixin confgenerator.LoggingReceiverFilesMixin `yaml:",inline"` - IncludePaths []string `yaml:"include_paths,omitempty" validate:"required"` +type LoggingReceiverMacroVaultAuditJson struct { + LoggingProcessorMacroVaultJson `yaml:",inline"` + ReceiverMixin confgenerator.LoggingReceiverFilesMixin `yaml:",inline"` + IncludePaths []string `yaml:"include_paths,omitempty" validate:"required"` } -func (r LoggingReceiverVaultAuditJson) Components(ctx context.Context, tag string) []fluentbit.Component { +func (r LoggingReceiverMacroVaultAuditJson) Expand(ctx context.Context) (confgenerator.InternalLoggingReceiver, []confgenerator.InternalLoggingProcessor) { r.ReceiverMixin.IncludePaths = r.IncludePaths r.ReceiverMixin.MultilineRules = []confgenerator.MultilineRule{ @@ -360,10 +353,10 @@ func (r LoggingReceiverVaultAuditJson) Components(ctx context.Context, tag strin }, } - c := r.ReceiverMixin.Components(ctx, tag) - return append(c, r.LoggingProcessorVaultJson.Components(ctx, tag, r.LoggingProcessorVaultJson.Type())...) + return &r.ReceiverMixin, r.LoggingProcessorMacroVaultJson.Expand(ctx) } func init() { - confgenerator.LoggingReceiverTypes.RegisterType(func() confgenerator.LoggingReceiver { return &LoggingReceiverVaultAuditJson{} }) + confgenerator.RegisterLoggingReceiverMacro[LoggingReceiverMacroVaultAuditJson](func() LoggingReceiverMacroVaultAuditJson { return LoggingReceiverMacroVaultAuditJson{} }) + confgenerator.RegisterLoggingProcessorMacro[LoggingProcessorMacroVaultJson]() } diff --git a/confgenerator/testdata/feature/golden.csv b/confgenerator/testdata/feature/golden.csv index 99bb0fb034..83f4d8bf3a 100644 --- a/confgenerator/testdata/feature/golden.csv +++ b/confgenerator/testdata/feature/golden.csv @@ -26,8 +26,6 @@ App,Field,Override, *apps.LoggingProcessorMysqlSlow,confgenerator.ConfigComponent.Type, *apps.LoggingProcessorNginxAccess,confgenerator.ConfigComponent.Type, *apps.LoggingProcessorNginxError,confgenerator.ConfigComponent.Type, -*apps.LoggingProcessorOracleDBAlert,confgenerator.ConfigComponent.Type, -*apps.LoggingProcessorOracleDBAudit,confgenerator.ConfigComponent.Type, *apps.LoggingProcessorPostgresql,confgenerator.ConfigComponent.Type, *apps.LoggingProcessorRedis,confgenerator.ConfigComponent.Type, *apps.LoggingProcessorSapHanaTrace,confgenerator.ConfigComponent.Type, @@ -113,14 +111,6 @@ App,Field,Override, *apps.LoggingReceiverNginxError,confgenerator.LoggingReceiverFilesMixin.BufferInMemory, *apps.LoggingReceiverNginxError,confgenerator.LoggingReceiverFilesMixin.RecordLogFilePath, *apps.LoggingReceiverNginxError,confgenerator.LoggingReceiverFilesMixin.WildcardRefreshInterval, -*apps.LoggingReceiverOracleDBAlert,apps.LoggingProcessorOracleDBAlert.confgenerator.ConfigComponent.Type, -*apps.LoggingReceiverOracleDBAlert,confgenerator.LoggingReceiverFilesMixin.BufferInMemory, -*apps.LoggingReceiverOracleDBAlert,confgenerator.LoggingReceiverFilesMixin.RecordLogFilePath, -*apps.LoggingReceiverOracleDBAlert,confgenerator.LoggingReceiverFilesMixin.WildcardRefreshInterval, -*apps.LoggingReceiverOracleDBAudit,apps.LoggingProcessorOracleDBAudit.confgenerator.ConfigComponent.Type, -*apps.LoggingReceiverOracleDBAudit,confgenerator.LoggingReceiverFilesMixin.BufferInMemory, -*apps.LoggingReceiverOracleDBAudit,confgenerator.LoggingReceiverFilesMixin.RecordLogFilePath, -*apps.LoggingReceiverOracleDBAudit,confgenerator.LoggingReceiverFilesMixin.WildcardRefreshInterval, *apps.LoggingReceiverPostgresql,apps.LoggingProcessorPostgresql.confgenerator.ConfigComponent.Type, *apps.LoggingReceiverPostgresql,confgenerator.LoggingReceiverFilesMixin.BufferInMemory, *apps.LoggingReceiverPostgresql,confgenerator.LoggingReceiverFilesMixin.RecordLogFilePath, @@ -145,10 +135,6 @@ App,Field,Override, *apps.LoggingReceiverVarnish,confgenerator.LoggingReceiverFilesMixin.BufferInMemory, *apps.LoggingReceiverVarnish,confgenerator.LoggingReceiverFilesMixin.RecordLogFilePath, *apps.LoggingReceiverVarnish,confgenerator.LoggingReceiverFilesMixin.WildcardRefreshInterval, -*apps.LoggingReceiverVaultAuditJson,apps.LoggingProcessorVaultJson.confgenerator.ConfigComponent.Type, -*apps.LoggingReceiverVaultAuditJson,confgenerator.LoggingReceiverFilesMixin.BufferInMemory, -*apps.LoggingReceiverVaultAuditJson,confgenerator.LoggingReceiverFilesMixin.RecordLogFilePath, -*apps.LoggingReceiverVaultAuditJson,confgenerator.LoggingReceiverFilesMixin.WildcardRefreshInterval, *apps.LoggingReceiverWildflySystem,apps.LoggingProcessorWildflySystem.confgenerator.ConfigComponent.Type, *apps.LoggingReceiverWildflySystem,confgenerator.LoggingReceiverFilesMixin.BufferInMemory, *apps.LoggingReceiverWildflySystem,confgenerator.LoggingReceiverFilesMixin.RecordLogFilePath, @@ -265,5 +251,19 @@ App,Field,Override, *confgenerator.PrometheusMetrics,config.[].scrape_configs.scrape_timeout *confgenerator.PrometheusMetrics,config.[].scrape_configs.static_config_target_groups *confgenerator.loggingProcessorMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingProcessorMacroFlink],confgenerator.ConfigComponent.Type, +*confgenerator.loggingProcessorMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingProcessorMacroOracleDBAlert],confgenerator.ConfigComponent.Type, +*confgenerator.loggingProcessorMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingProcessorMacroOracleDBAudit],confgenerator.ConfigComponent.Type, *confgenerator.loggingReceiverMacroAdapter[*github.com/GoogleCloudPlatform/ops-agent/confgenerator.loggingFilesProcessorMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingProcessorMacroFlink]],ReceiverMacro, *confgenerator.loggingReceiverMacroAdapter[*github.com/GoogleCloudPlatform/ops-agent/confgenerator.loggingFilesProcessorMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingProcessorMacroFlink]],confgenerator.ConfigComponent.Type, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroOracleDBAlert],apps.LoggingReceiverMacroOracleDBAlert.confgenerator.LoggingReceiverFilesMixin.BufferInMemory, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroOracleDBAlert],apps.LoggingReceiverMacroOracleDBAlert.confgenerator.LoggingReceiverFilesMixin.RecordLogFilePath, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroOracleDBAlert],apps.LoggingReceiverMacroOracleDBAlert.confgenerator.LoggingReceiverFilesMixin.WildcardRefreshInterval, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroOracleDBAlert],confgenerator.ConfigComponent.Type, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroOracleDBAudit],apps.LoggingReceiverMacroOracleDBAudit.confgenerator.LoggingReceiverFilesMixin.BufferInMemory, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroOracleDBAudit],apps.LoggingReceiverMacroOracleDBAudit.confgenerator.LoggingReceiverFilesMixin.RecordLogFilePath, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroOracleDBAudit],apps.LoggingReceiverMacroOracleDBAudit.confgenerator.LoggingReceiverFilesMixin.WildcardRefreshInterval, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroOracleDBAudit],confgenerator.ConfigComponent.Type, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroVaultAuditJson],apps.LoggingReceiverMacroVaultAuditJson.confgenerator.LoggingReceiverFilesMixin.BufferInMemory, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroVaultAuditJson],apps.LoggingReceiverMacroVaultAuditJson.confgenerator.LoggingReceiverFilesMixin.RecordLogFilePath, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroVaultAuditJson],apps.LoggingReceiverMacroVaultAuditJson.confgenerator.LoggingReceiverFilesMixin.WildcardRefreshInterval, +*confgenerator.loggingReceiverMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingReceiverMacroVaultAuditJson],confgenerator.ConfigComponent.Type, diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/linux-gpu/error b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/linux-gpu/error index 8898f9bba8..8f2a7108d0 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/linux-gpu/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/linux-gpu/error @@ -1,8 +1 @@ -[17:19] Key: 'LoggingReceiverOracleDBAlert.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverOracleDBAlert.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag - 15 | logging: - 16 | receivers: -> 17 | oracledb_alert: - ^ - 18 | type: oracledb_alert - 19 | service: - 20 | pipelines: \ No newline at end of file +Key: 'LoggingReceiverMacroOracleDBAlert.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverMacroOracleDBAlert.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/linux/error b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/linux/error index 8898f9bba8..8f2a7108d0 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/linux/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/linux/error @@ -1,8 +1 @@ -[17:19] Key: 'LoggingReceiverOracleDBAlert.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverOracleDBAlert.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag - 15 | logging: - 16 | receivers: -> 17 | oracledb_alert: - ^ - 18 | type: oracledb_alert - 19 | service: - 20 | pipelines: \ No newline at end of file +Key: 'LoggingReceiverMacroOracleDBAlert.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverMacroOracleDBAlert.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/windows-2012/error b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/windows-2012/error index 8898f9bba8..8f2a7108d0 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/windows-2012/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/windows-2012/error @@ -1,8 +1 @@ -[17:19] Key: 'LoggingReceiverOracleDBAlert.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverOracleDBAlert.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag - 15 | logging: - 16 | receivers: -> 17 | oracledb_alert: - ^ - 18 | type: oracledb_alert - 19 | service: - 20 | pipelines: \ No newline at end of file +Key: 'LoggingReceiverMacroOracleDBAlert.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverMacroOracleDBAlert.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/windows/error b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/windows/error index 8898f9bba8..8f2a7108d0 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/windows/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_alert_location_missing/golden/windows/error @@ -1,8 +1 @@ -[17:19] Key: 'LoggingReceiverOracleDBAlert.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverOracleDBAlert.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag - 15 | logging: - 16 | receivers: -> 17 | oracledb_alert: - ^ - 18 | type: oracledb_alert - 19 | service: - 20 | pipelines: \ No newline at end of file +Key: 'LoggingReceiverMacroOracleDBAlert.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverMacroOracleDBAlert.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/linux-gpu/error b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/linux-gpu/error index 7581efda55..c66eae441f 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/linux-gpu/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/linux-gpu/error @@ -1,8 +1 @@ -[17:19] Key: 'LoggingReceiverOracleDBAudit.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverOracleDBAudit.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag - 15 | logging: - 16 | receivers: -> 17 | oracledb_audit: - ^ - 18 | type: oracledb_audit - 19 | service: - 20 | pipelines: \ No newline at end of file +Key: 'LoggingReceiverMacroOracleDBAudit.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverMacroOracleDBAudit.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/linux/error b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/linux/error index 7581efda55..c66eae441f 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/linux/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/linux/error @@ -1,8 +1 @@ -[17:19] Key: 'LoggingReceiverOracleDBAudit.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverOracleDBAudit.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag - 15 | logging: - 16 | receivers: -> 17 | oracledb_audit: - ^ - 18 | type: oracledb_audit - 19 | service: - 20 | pipelines: \ No newline at end of file +Key: 'LoggingReceiverMacroOracleDBAudit.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverMacroOracleDBAudit.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/windows-2012/error b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/windows-2012/error index 7581efda55..c66eae441f 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/windows-2012/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/windows-2012/error @@ -1,8 +1 @@ -[17:19] Key: 'LoggingReceiverOracleDBAudit.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverOracleDBAudit.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag - 15 | logging: - 16 | receivers: -> 17 | oracledb_audit: - ^ - 18 | type: oracledb_audit - 19 | service: - 20 | pipelines: \ No newline at end of file +Key: 'LoggingReceiverMacroOracleDBAudit.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverMacroOracleDBAudit.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/windows/error b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/windows/error index 7581efda55..c66eae441f 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/windows/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_oracledb_audit_location_missing/golden/windows/error @@ -1,8 +1 @@ -[17:19] Key: 'LoggingReceiverOracleDBAudit.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverOracleDBAudit.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag - 15 | logging: - 16 | receivers: -> 17 | oracledb_audit: - ^ - 18 | type: oracledb_audit - 19 | service: - 20 | pipelines: \ No newline at end of file +Key: 'LoggingReceiverMacroOracleDBAudit.include_paths' Error:Field validation for 'include_paths' failed on the 'required_without' tag,Key: 'LoggingReceiverMacroOracleDBAudit.oracle_home' Error:Field validation for 'oracle_home' failed on the 'required_without' tag \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/linux-gpu/error b/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/linux-gpu/error index e252b0d5d1..7107dfae58 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/linux-gpu/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/linux-gpu/error @@ -1,8 +1 @@ -[17:16] "include_paths" is a required field - 15 | logging: - 16 | receivers: -> 17 | vault_audit: - ^ - 18 | type: vault_audit - 19 | service: - 20 | pipelines: \ No newline at end of file +"include_paths" is a required field \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/linux/error b/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/linux/error index e252b0d5d1..7107dfae58 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/linux/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/linux/error @@ -1,8 +1 @@ -[17:16] "include_paths" is a required field - 15 | logging: - 16 | receivers: -> 17 | vault_audit: - ^ - 18 | type: vault_audit - 19 | service: - 20 | pipelines: \ No newline at end of file +"include_paths" is a required field \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/windows-2012/error b/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/windows-2012/error index e252b0d5d1..7107dfae58 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/windows-2012/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/windows-2012/error @@ -1,8 +1 @@ -[17:16] "include_paths" is a required field - 15 | logging: - 16 | receivers: -> 17 | vault_audit: - ^ - 18 | type: vault_audit - 19 | service: - 20 | pipelines: \ No newline at end of file +"include_paths" is a required field \ No newline at end of file diff --git a/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/windows/error b/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/windows/error index e252b0d5d1..7107dfae58 100644 --- a/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/windows/error +++ b/confgenerator/testdata/goldens/invalid-logging-receiver_vault_missing_required_include_path/golden/windows/error @@ -1,8 +1 @@ -[17:16] "include_paths" is a required field - 15 | logging: - 16 | receivers: -> 17 | vault_audit: - ^ - 18 | type: vault_audit - 19 | service: - 20 | pipelines: \ No newline at end of file +"include_paths" is a required field \ No newline at end of file diff --git a/transformation_test/testdata/logging_processor-oracledb_alert/config.yaml b/transformation_test/testdata/logging_processor-oracledb_alert/config.yaml new file mode 100644 index 0000000000..2e02f516cc --- /dev/null +++ b/transformation_test/testdata/logging_processor-oracledb_alert/config.yaml @@ -0,0 +1 @@ +- type: oracledb_alert diff --git a/transformation_test/testdata/logging_processor-oracledb_alert/input.log b/transformation_test/testdata/logging_processor-oracledb_alert/input.log new file mode 100644 index 0000000000..1d17f4817f --- /dev/null +++ b/transformation_test/testdata/logging_processor-oracledb_alert/input.log @@ -0,0 +1,4 @@ +2021-12-21T10:19:47.339827-05:00 +Thread 1 opened at log sequence 1 +Current log# 1 seq# 1 mem# 0: /u01/oracle/oradata/DB19C/redo01.log +Successful open of redo thread 1 \ No newline at end of file diff --git a/transformation_test/testdata/logging_processor-oracledb_alert/output_fluentbit.yaml b/transformation_test/testdata/logging_processor-oracledb_alert/output_fluentbit.yaml new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/transformation_test/testdata/logging_processor-oracledb_alert/output_fluentbit.yaml @@ -0,0 +1 @@ +[] diff --git a/transformation_test/testdata/logging_processor-oracledb_alert/output_otel.yaml b/transformation_test/testdata/logging_processor-oracledb_alert/output_otel.yaml new file mode 100644 index 0000000000..c520822dff --- /dev/null +++ b/transformation_test/testdata/logging_processor-oracledb_alert/output_otel.yaml @@ -0,0 +1 @@ +- config_error: "failed generating OTel processor: &confgenerator.loggingProcessorMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingProcessorMacroOracleDBAlert]{ConfigComponent:confgenerator.ConfigComponent{Type:\"oracledb_alert\"}, ProcessorMacro:apps.LoggingProcessorMacroOracleDBAlert{}}, err: unimplemented" diff --git a/transformation_test/testdata/logging_processor-oracledb_audit/config.yaml b/transformation_test/testdata/logging_processor-oracledb_audit/config.yaml new file mode 100644 index 0000000000..c1fa3e9918 --- /dev/null +++ b/transformation_test/testdata/logging_processor-oracledb_audit/config.yaml @@ -0,0 +1 @@ +- type: oracledb_audit diff --git a/transformation_test/testdata/logging_processor-oracledb_audit/input.log b/transformation_test/testdata/logging_processor-oracledb_audit/input.log new file mode 100644 index 0000000000..644e8e1d28 --- /dev/null +++ b/transformation_test/testdata/logging_processor-oracledb_audit/input.log @@ -0,0 +1,21 @@ +Wed Sep 14 16:18:03 2022 +00:00 +LENGTH : '623' +ACTION :[373] 'select distinct 'ALTER SYSTEM KILL SESSION ''' || stat.sid || ',' || + sess.serial# || + decode(substr(inst.version, 1, 4), + '12.1', ''' immediate ', ''' force timeout 0 ') || + '-- process 73841' +FROM SYS.V$mystat stat, v$session sess, v$instance inst +where stat.sid=sess.sid +union all +select '/' from dual' +DATABASE USER:[1] '/' +PRIVILEGE :[6] 'SYSDBA' +CLIENT USER:[6] 'oracle' +CLIENT TERMINAL:[5] 'pts/1' +STATUS:[1] '0' +DBID:[10] '1643176521' +SESSIONID:[10] '4294967295' +USERHOST:[7] 'oradb19' +CLIENT ADDRESS:[0] '' +ACTION NUMBER:[1] '3' \ No newline at end of file diff --git a/transformation_test/testdata/logging_processor-oracledb_audit/output_fluentbit.yaml b/transformation_test/testdata/logging_processor-oracledb_audit/output_fluentbit.yaml new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/transformation_test/testdata/logging_processor-oracledb_audit/output_fluentbit.yaml @@ -0,0 +1 @@ +[] diff --git a/transformation_test/testdata/logging_processor-oracledb_audit/output_otel.yaml b/transformation_test/testdata/logging_processor-oracledb_audit/output_otel.yaml new file mode 100644 index 0000000000..e187555e59 --- /dev/null +++ b/transformation_test/testdata/logging_processor-oracledb_audit/output_otel.yaml @@ -0,0 +1 @@ +- config_error: "failed generating OTel processor: &confgenerator.loggingProcessorMacroAdapter[github.com/GoogleCloudPlatform/ops-agent/apps.LoggingProcessorMacroOracleDBAudit]{ConfigComponent:confgenerator.ConfigComponent{Type:\"oracledb_audit\"}, ProcessorMacro:apps.LoggingProcessorMacroOracleDBAudit{}}, err: unimplemented" diff --git a/transformation_test/testdata/logging_processor-vault/config.yaml b/transformation_test/testdata/logging_processor-vault/config.yaml new file mode 100644 index 0000000000..639167f335 --- /dev/null +++ b/transformation_test/testdata/logging_processor-vault/config.yaml @@ -0,0 +1 @@ +- type: vault_audit diff --git a/transformation_test/testdata/logging_processor-vault/input.log b/transformation_test/testdata/logging_processor-vault/input.log new file mode 100644 index 0000000000..125d8babbf --- /dev/null +++ b/transformation_test/testdata/logging_processor-vault/input.log @@ -0,0 +1,2 @@ +{"time":"2022-06-07T20:34:34.392078404Z","type":"request","auth":{"token_type":"default"},"request":{"id":"aa005196-0280-381d-ebeb-1a083bdf5675","operation":"update","namespace":{"id":"root"},"path":"sys/audit/test"}} +{"auth":{"accessor":"hmac-sha256:aaaaa11111","client_token":"hmac-sha256:aaaaa11111","display_name":"root","policies":["root"],"policy_results":{"allowed":true,"granting_policies":[{"type":""},{"name":"root","namespace_id":"root","type":"acl"}]},"token_policies":["root"],"token_issue_time":"2025-05-26T23:16:27Z","token_type":"service"},"request":{"client_id":"aaaaa11111/aaaaa11111=","client_token":"hmac-sha256:aaaaa11111","client_token_accessor":"hmac-sha256:aaaaa11111","data":{"description":"hmac-sha256:aaaaa11111","local":false,"options":{"file_path":"hmac-sha256:aaaaa11111"},"type":"hmac-sha256:aaaaa11111"},"headers":{"user-agent":["Go-http-client/1.1"]},"id":"45821973-b531-6747-758e-450c5c6afccc","mount_accessor":"system_8099e0eb","mount_class":"secret","mount_point":"sys/","mount_running_version":"v1.19.4+builtin.vault","mount_type":"system","namespace":{"id":"root"},"operation":"update","path":"sys/audit/file","remote_address":"127.0.0.1","remote_port":48316},"time":"2025-05-26T23:16:27.520933731Z","type":"response"} \ No newline at end of file diff --git a/transformation_test/testdata/logging_processor-vault/output_fluentbit.yaml b/transformation_test/testdata/logging_processor-vault/output_fluentbit.yaml new file mode 100644 index 0000000000..34562a8557 --- /dev/null +++ b/transformation_test/testdata/logging_processor-vault/output_fluentbit.yaml @@ -0,0 +1,19 @@ +- entries: + - jsonPayload: + auth: + token_type: default + request: + id: aa005196-0280-381d-ebeb-1a083bdf5675 + namespace: + id: root + operation: update + path: sys/audit/test + type: request + labels: + logging.googleapis.com/instrumentation_source: agent.googleapis.com/vault_audit + logName: projects/my-project/logs/transformation_test + timestamp: 2022-06-07T20:34:34.392078404Z + partialSuccess: true + resource: + labels: {} + type: gce_instance diff --git a/transformation_test/testdata/logging_processor-vault/output_otel.yaml b/transformation_test/testdata/logging_processor-vault/output_otel.yaml new file mode 100644 index 0000000000..7a5538e8ca --- /dev/null +++ b/transformation_test/testdata/logging_processor-vault/output_otel.yaml @@ -0,0 +1,21 @@ +- entries: + - jsonPayload: + auth: + token_type: default + request: + id: aa005196-0280-381d-ebeb-1a083bdf5675 + namespace: + id: root + operation: update + path: sys/audit/test + type: request + labels: + logging.googleapis.com/instrumentation_source: agent.googleapis.com/vault_audit + logName: projects/my-project/logs/my-log-name + resource: + labels: + instance_id: test-instance-id + zone: test-zone + type: gce_instance + timestamp: 2022-06-07T20:34:34.392078404Z + partialSuccess: true