summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_bucket_logging.cc
diff options
context:
space:
mode:
authorAli Masarwa <amasarwa@redhat.com>2024-12-10 14:09:50 +0100
committerAli Masarwa <amasarwa@redhat.com>2024-12-17 12:06:11 +0100
commite03f5ca25f2b63ab4efab5860701293246aac9c9 (patch)
tree35ee67294af520f89c7e2d2cfff940b395a1944a /src/rgw/rgw_bucket_logging.cc
parentRGW/logging: add filtering for bucket logging (diff)
downloadceph-e03f5ca25f2b63ab4efab5860701293246aac9c9.tar.xz
ceph-e03f5ca25f2b63ab4efab5860701293246aac9c9.zip
RGW\logging: convert s3_filter to key_filter
Signed-off-by: Ali Masarwa <amasarwa@redhat.com>
Diffstat (limited to 'src/rgw/rgw_bucket_logging.cc')
-rw-r--r--src/rgw/rgw_bucket_logging.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/rgw/rgw_bucket_logging.cc b/src/rgw/rgw_bucket_logging.cc
index f63efeee940..d24a53024f1 100644
--- a/src/rgw/rgw_bucket_logging.cc
+++ b/src/rgw/rgw_bucket_logging.cc
@@ -31,7 +31,9 @@ bool configuration::decode_xml(XMLObj* obj) {
logging_type = LoggingType::Standard;
} else if (type == "Journal") {
logging_type = LoggingType::Journal;
- RGWXMLDecoder::decode_xml("Filter", s3_filter, o);
+ if (iter = o->find("Filter"); XMLObj* const filter_o = iter.get_next()) {
+ RGWXMLDecoder::decode_xml("S3Key", key_filter, filter_o);
+ }
} else {
// we don't allow for type "Any" in the configuration
throw RGWXMLDecoder::err("invalid bucket logging record type: '" + type + "'");
@@ -74,8 +76,10 @@ void configuration::dump_xml(Formatter *f) const {
break;
case LoggingType::Journal:
::encode_xml("LoggingType", "Journal", f);
- if (s3_filter.has_content()) {
- ::encode_xml("Filter", s3_filter, f);
+ if (key_filter.has_content()) {
+ f->open_object_section("Filter");
+ ::encode_xml("S3Key", key_filter, f);
+ f->close_section(); // Filter
}
break;
case LoggingType::Any:
@@ -122,8 +126,9 @@ void configuration::dump(Formatter *f) const {
break;
case LoggingType::Journal:
encode_json("loggingType", "Journal", f);
- if (s3_filter.has_content()) {
- encode_json("Filter", s3_filter, f);
+ if (key_filter.has_content()) {
+ Formatter::ObjectSection s(*f, "Filter");
+ encode_json("S3Key", key_filter, f);
}
break;
case LoggingType::Any:
@@ -533,8 +538,8 @@ int log_record(rgw::sal::Driver* driver,
if (type != LoggingType::Any && configuration.logging_type != type) {
return 0;
}
- if (configuration.s3_filter.has_content()) {
- if (!match(configuration.s3_filter, obj)) {
+ if (configuration.key_filter.has_content()) {
+ if (!match(configuration.key_filter, obj->get_name())) {
return 0;
}
}