diff --git a/confgenerator/config.go b/confgenerator/config.go index 79b60d7093..1b4ff3a2f3 100644 --- a/confgenerator/config.go +++ b/confgenerator/config.go @@ -90,6 +90,10 @@ func (ve validationError) Error() string { return fmt.Sprintf("%q must end with %q", ve.Field(), ve.Param()) case "ip": return fmt.Sprintf("%q must be an IP address", ve.Field()) + case "min": + return fmt.Sprintf("%q must be a minimum of %s", ve.Field(), ve.Param()) + case "multipleof_time": + return fmt.Sprintf("%q must be a multiple of %s", ve.Field(), ve.Param()) case "oneof": return fmt.Sprintf("%q must be one of [%s]", ve.Field(), ve.Param()) case "required": @@ -137,7 +141,7 @@ func newValidator() *validator.Validate { v.RegisterValidationCtx("platform", func(ctx context.Context, fl validator.FieldLevel) bool { return ctx.Value(platformKey) == fl.Param() }) - // duration validates that the value is a valid durationa and >= the parameter + // duration validates that the value is a valid duration and >= the parameter v.RegisterValidation("duration", func(fl validator.FieldLevel) bool { t, err := time.ParseDuration(fl.Field().String()) if err != nil { @@ -149,6 +153,18 @@ func newValidator() *validator.Validate { } return t >= tmin }) + // multipleof_time validates that the value duration is a multiple of the parameter + v.RegisterValidation("multipleof_time", func(fl validator.FieldLevel) bool { + t, ok := fl.Field().Interface().(time.Duration) + if !ok { + panic(fmt.Sprintf("multipleof_time: could not convert %s to time duration", fl.Field().String())) + } + tfactor, err := time.ParseDuration(fl.Param()) + if err != nil { + panic(fmt.Sprintf("multipleof_time: could not convert %s to time duration", fl.Param())) + } + return t%tfactor == 0 + }) return v } diff --git a/confgenerator/logging_receivers.go b/confgenerator/logging_receivers.go index cf1397d4cc..e0c1d1b6a3 100644 --- a/confgenerator/logging_receivers.go +++ b/confgenerator/logging_receivers.go @@ -17,7 +17,9 @@ package confgenerator import ( "fmt" "path" + "strconv" "strings" + "time" "github.com/GoogleCloudPlatform/ops-agent/confgenerator/fluentbit" ) @@ -33,8 +35,9 @@ func DBPath(tag string) string { type LoggingReceiverFiles struct { ConfigComponent `yaml:",inline"` // TODO: Use LoggingReceiverFilesMixin after figuring out the validation story. - IncludePaths []string `yaml:"include_paths,omitempty" validate:"required"` - ExcludePaths []string `yaml:"exclude_paths,omitempty"` + IncludePaths []string `yaml:"include_paths,omitempty" validate:"required"` + ExcludePaths []string `yaml:"exclude_paths,omitempty"` + WildcardRefreshInterval *time.Duration `yaml:"wildcard_refresh_interval,omitempty" validate:"omitempty,min=1s,multipleof_time=1s"` } func (r LoggingReceiverFiles) Type() string { @@ -43,14 +46,16 @@ func (r LoggingReceiverFiles) Type() string { func (r LoggingReceiverFiles) Components(tag string) []fluentbit.Component { return LoggingReceiverFilesMixin{ - IncludePaths: r.IncludePaths, - ExcludePaths: r.ExcludePaths, + IncludePaths: r.IncludePaths, + ExcludePaths: r.ExcludePaths, + WildcardRefreshInterval: r.WildcardRefreshInterval, }.Components(tag) } type LoggingReceiverFilesMixin struct { - IncludePaths []string `yaml:"include_paths,omitempty"` - ExcludePaths []string `yaml:"exclude_paths,omitempty"` + IncludePaths []string `yaml:"include_paths,omitempty"` + ExcludePaths []string `yaml:"exclude_paths,omitempty"` + WildcardRefreshInterval *time.Duration `yaml:"wildcard_refresh_interval,omitempty" validate:"omitempty,min=1s,multipleof_time=1s"` } func (r LoggingReceiverFilesMixin) Components(tag string) []fluentbit.Component { @@ -92,6 +97,10 @@ func (r LoggingReceiverFilesMixin) Components(tag string) []fluentbit.Component // TODO: Escaping? config["Exclude_Path"] = strings.Join(r.ExcludePaths, ",") } + if r.WildcardRefreshInterval != nil { + refreshIntervalSeconds := int(r.WildcardRefreshInterval.Seconds()) + config["Refresh_Interval"] = strconv.Itoa(refreshIntervalSeconds) + } return []fluentbit.Component{{ Kind: "INPUT", Config: config, diff --git a/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_invalid_duration/golden_error b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_invalid_duration/golden_error new file mode 100644 index 0000000000..8de59dec81 --- /dev/null +++ b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_invalid_duration/golden_error @@ -0,0 +1 @@ +cannot unmarshal uint64 into Go struct field UnifiedConfig.Logging of type time.Duration \ No newline at end of file diff --git a/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_invalid_duration/input.yaml b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_invalid_duration/input.yaml new file mode 100644 index 0000000000..4ded2f9b40 --- /dev/null +++ b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_invalid_duration/input.yaml @@ -0,0 +1,26 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +logging: + receivers: + log_source_id1: + type: files + include_paths: + - /path/to/log/1/* + wildcard_refresh_interval: 30 + service: + pipelines: + pipeline1: + receivers: + - log_source_id1 \ No newline at end of file diff --git a/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_not_whole_seconds/golden_error b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_not_whole_seconds/golden_error new file mode 100644 index 0000000000..1b4f5f7d36 --- /dev/null +++ b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_not_whole_seconds/golden_error @@ -0,0 +1,9 @@ +[21:34] "wildcard_refresh_interval" must be a multiple of 1s + 18 | type: files + 19 | include_paths: + 20 | - /path/to/log/1/* +> 21 | wildcard_refresh_interval: 3500ms + ^ + 22 | service: + 23 | pipelines: + 24 | pipeline1: \ No newline at end of file diff --git a/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_not_whole_seconds/input.yaml b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_not_whole_seconds/input.yaml new file mode 100644 index 0000000000..2bc25bb13b --- /dev/null +++ b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_not_whole_seconds/input.yaml @@ -0,0 +1,26 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +logging: + receivers: + log_source_id1: + type: files + include_paths: + - /path/to/log/1/* + wildcard_refresh_interval: 3500ms + service: + pipelines: + pipeline1: + receivers: + - log_source_id1 \ No newline at end of file diff --git a/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_too_low/golden_error b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_too_low/golden_error new file mode 100644 index 0000000000..0e8543db0e --- /dev/null +++ b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_too_low/golden_error @@ -0,0 +1,9 @@ +[21:34] "wildcard_refresh_interval" must be a minimum of 1s + 18 | type: files + 19 | include_paths: + 20 | - /path/to/log/1/* +> 21 | wildcard_refresh_interval: 0s + ^ + 22 | service: + 23 | pipelines: + 24 | pipeline1: \ No newline at end of file diff --git a/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_too_low/input.yaml b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_too_low/input.yaml new file mode 100644 index 0000000000..b8569ab777 --- /dev/null +++ b/confgenerator/testdata/invalid/linux/logging-receiver_files_refresh_interval_too_low/input.yaml @@ -0,0 +1,26 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +logging: + receivers: + log_source_id1: + type: files + include_paths: + - /path/to/log/1/* + wildcard_refresh_interval: 0s + service: + pipelines: + pipeline1: + receivers: + - log_source_id1 \ No newline at end of file diff --git a/confgenerator/testdata/valid/linux/logging-receiver_apache_refresh_interval/golden_fluent_bit_main.conf b/confgenerator/testdata/valid/linux/logging-receiver_apache_refresh_interval/golden_fluent_bit_main.conf new file mode 100644 index 0000000000..9a8705cdd9 --- /dev/null +++ b/confgenerator/testdata/valid/linux/logging-receiver_apache_refresh_interval/golden_fluent_bit_main.conf @@ -0,0 +1,578 @@ +@SET buffers_dir=/var/lib/google-cloud-ops-agent/fluent-bit/buffers +@SET logs_dir=/var/log/google-cloud-ops-agent/subagents + +[SERVICE] + Daemon off + Flush 1 + HTTP_Listen 0.0.0.0 + HTTP_PORT 2020 + HTTP_Server On + Log_Level info + storage.backlog.mem_limit 50M + storage.checksum on + storage.max_chunks_up 128 + storage.metrics on + storage.sync normal + +[INPUT] + Buffer_Chunk_Size 512k + Buffer_Max_Size 5M + DB ${buffers_dir}/apache_custom_apache_custom_access + Key message + Mem_Buf_Limit 10M + Name tail + Path /var/log/apache2/vhosts.log + Read_from_Head True + Refresh_Interval 30 + Rotate_Wait 30 + Skip_Long_Lines On + Tag apache_custom.apache_custom_access + storage.type filesystem + +[INPUT] + Buffer_Chunk_Size 512k + Buffer_Max_Size 5M + DB ${buffers_dir}/apache_custom_apache_custom_error + Key message + Mem_Buf_Limit 10M + Name tail + Path /srv/apache2/error.log + Read_from_Head True + Refresh_Interval 45 + Rotate_Wait 30 + Skip_Long_Lines On + Tag apache_custom.apache_custom_error + storage.type filesystem + +[INPUT] + Buffer_Chunk_Size 512k + Buffer_Max_Size 5M + DB ${buffers_dir}/apache_default_apache_default_access + Key message + Mem_Buf_Limit 10M + Name tail + Path /var/log/apache2/access.log,/var/log/apache2/access_log,/var/log/httpd/access_log + Read_from_Head True + Rotate_Wait 30 + Skip_Long_Lines On + Tag apache_default.apache_default_access + storage.type filesystem + +[INPUT] + Buffer_Chunk_Size 512k + Buffer_Max_Size 5M + DB ${buffers_dir}/apache_default_apache_default_error + Key message + Mem_Buf_Limit 10M + Name tail + Path /var/log/apache2/error.log,/var/log/apache2/error_log,/var/log/httpd/error_log + Read_from_Head True + Rotate_Wait 30 + Skip_Long_Lines On + Tag apache_default.apache_default_error + storage.type filesystem + +[INPUT] + Listen 1.1.1.1 + Mem_Buf_Limit 10M + Mode udp + Name syslog + Parser apache_syslog_access.apache_syslog_access + Port 1 + Tag apache_syslog_access.apache_syslog_access + storage.type filesystem + +[INPUT] + Listen 1.1.1.1 + Mem_Buf_Limit 10M + Mode tcp + Name syslog + Parser apache_syslog_error.apache_syslog_error + Port 2 + Tag apache_syslog_error.apache_syslog_error + storage.type filesystem + +[INPUT] + Buffer_Chunk_Size 512k + Buffer_Max_Size 5M + DB ${buffers_dir}/default_pipeline_syslog + Key message + Mem_Buf_Limit 10M + Name tail + Path /var/log/messages,/var/log/syslog + Read_from_Head True + Rotate_Wait 30 + Skip_Long_Lines On + Tag default_pipeline.syslog + storage.type filesystem + +[INPUT] + Buffer_Chunk_Size 512k + Buffer_Max_Size 5M + DB ${buffers_dir}/ops-agent-fluent-bit + Key message + Mem_Buf_Limit 10M + Name tail + Path ${logs_dir}/logging-module.log + Read_from_Head True + Rotate_Wait 30 + Skip_Long_Lines On + Tag ops-agent-fluent-bit + storage.type filesystem + +[FILTER] + Key_Name message + Match apache_custom.apache_custom_access + Name parser + Parser apache_custom.apache_custom_access.apache_access + +[FILTER] + Condition Key_Value_Equals host - + Match apache_custom.apache_custom_access + Name modify + Remove host + +[FILTER] + Condition Key_Value_Equals user - + Match apache_custom.apache_custom_access + Name modify + Remove user + +[FILTER] + Condition Key_Value_Equals http_request_referer - + Match apache_custom.apache_custom_access + Name modify + Remove http_request_referer + +[FILTER] + Match apache_custom.apache_custom_access + Name nest + Nest_under logging.googleapis.com/http_request + Operation nest + Remove_prefix http_request_ + Wildcard http_request_* + +[FILTER] + Add logging.googleapis.com/logName apache_custom_access + Match apache_custom.apache_custom_access + Name modify + +[FILTER] + Key_Name message + Match apache_custom.apache_custom_error + Name parser + Parser apache_custom.apache_custom_error.apache_error + +[FILTER] + Add logging.googleapis.com/severity EMERGENCY + Condition Key_Value_Equals level emerg + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity ALERT + Condition Key_Value_Equals level alert + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity CRITICAL + Condition Key_Value_Equals level crit + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity ERROR + Condition Key_Value_Equals level error + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity WARNING + Condition Key_Value_Equals level warn + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity NOTICE + Condition Key_Value_Equals level notice + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity INFO + Condition Key_Value_Equals level info + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level debug + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace1 + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace2 + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace3 + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace4 + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace5 + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace6 + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace7 + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace8 + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Add logging.googleapis.com/logName apache_custom_error + Match apache_custom.apache_custom_error + Name modify + +[FILTER] + Key_Name message + Match apache_default.apache_default_access + Name parser + Parser apache_default.apache_default_access.apache_access + +[FILTER] + Condition Key_Value_Equals host - + Match apache_default.apache_default_access + Name modify + Remove host + +[FILTER] + Condition Key_Value_Equals user - + Match apache_default.apache_default_access + Name modify + Remove user + +[FILTER] + Condition Key_Value_Equals http_request_referer - + Match apache_default.apache_default_access + Name modify + Remove http_request_referer + +[FILTER] + Match apache_default.apache_default_access + Name nest + Nest_under logging.googleapis.com/http_request + Operation nest + Remove_prefix http_request_ + Wildcard http_request_* + +[FILTER] + Add logging.googleapis.com/logName apache_default_access + Match apache_default.apache_default_access + Name modify + +[FILTER] + Key_Name message + Match apache_default.apache_default_error + Name parser + Parser apache_default.apache_default_error.apache_error + +[FILTER] + Add logging.googleapis.com/severity EMERGENCY + Condition Key_Value_Equals level emerg + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity ALERT + Condition Key_Value_Equals level alert + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity CRITICAL + Condition Key_Value_Equals level crit + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity ERROR + Condition Key_Value_Equals level error + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity WARNING + Condition Key_Value_Equals level warn + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity NOTICE + Condition Key_Value_Equals level notice + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity INFO + Condition Key_Value_Equals level info + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level debug + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace1 + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace2 + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace3 + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace4 + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace5 + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace6 + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace7 + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace8 + Match apache_default.apache_default_error + Name modify + +[FILTER] + Add logging.googleapis.com/logName apache_default_error + Match apache_default.apache_default_error + Name modify + +[FILTER] + Key_Name message + Match apache_syslog_access.apache_syslog_access + Name parser + Parser apache_syslog_access.apache_syslog_access.0 + +[FILTER] + Condition Key_Value_Equals host - + Match apache_syslog_access.apache_syslog_access + Name modify + Remove host + +[FILTER] + Condition Key_Value_Equals user - + Match apache_syslog_access.apache_syslog_access + Name modify + Remove user + +[FILTER] + Condition Key_Value_Equals http_request_referer - + Match apache_syslog_access.apache_syslog_access + Name modify + Remove http_request_referer + +[FILTER] + Match apache_syslog_access.apache_syslog_access + Name nest + Nest_under logging.googleapis.com/http_request + Operation nest + Remove_prefix http_request_ + Wildcard http_request_* + +[FILTER] + Add logging.googleapis.com/logName apache_syslog_access + Match apache_syslog_access.apache_syslog_access + Name modify + +[FILTER] + Key_Name message + Match apache_syslog_error.apache_syslog_error + Name parser + Parser apache_syslog_error.apache_syslog_error.0 + +[FILTER] + Add logging.googleapis.com/severity EMERGENCY + Condition Key_Value_Equals level emerg + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity ALERT + Condition Key_Value_Equals level alert + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity CRITICAL + Condition Key_Value_Equals level crit + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity ERROR + Condition Key_Value_Equals level error + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity WARNING + Condition Key_Value_Equals level warn + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity NOTICE + Condition Key_Value_Equals level notice + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity INFO + Condition Key_Value_Equals level info + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level debug + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace1 + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace2 + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace3 + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace4 + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace5 + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace6 + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace7 + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/severity DEBUG + Condition Key_Value_Equals level trace8 + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/logName apache_syslog_error + Match apache_syslog_error.apache_syslog_error + Name modify + +[FILTER] + Add logging.googleapis.com/logName syslog + Match default_pipeline.syslog + Name modify + +[OUTPUT] + Match_Regex ^(apache_custom\.apache_custom_access|apache_custom\.apache_custom_error|apache_default\.apache_default_access|apache_default\.apache_default_error|apache_syslog_access\.apache_syslog_access|apache_syslog_error\.apache_syslog_error|default_pipeline\.syslog)$ + Name stackdriver + Retry_Limit 3 + resource gce_instance + stackdriver_agent Google-Cloud-Ops-Agent-Logging/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) + tls On + tls.verify Off + workers 8 + +[OUTPUT] + Match_Regex ^(ops-agent-fluent-bit)$ + Name stackdriver + Retry_Limit 3 + resource gce_instance + stackdriver_agent Google-Cloud-Ops-Agent-Logging/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) + tls On + tls.verify Off + workers 8 diff --git a/confgenerator/testdata/valid/linux/logging-receiver_apache_refresh_interval/golden_fluent_bit_parser.conf b/confgenerator/testdata/valid/linux/logging-receiver_apache_refresh_interval/golden_fluent_bit_parser.conf new file mode 100644 index 0000000000..f037da3a92 --- /dev/null +++ b/confgenerator/testdata/valid/linux/logging-receiver_apache_refresh_interval/golden_fluent_bit_parser.conf @@ -0,0 +1,57 @@ +[PARSER] + Format regex + Name apache_custom.apache_custom_access.apache_access + Regex ^(?[^ ]*) (?[^ ]*) (?[^ ]*) \[(?