@@ -329,13 +329,19 @@ def process_raw_log_field(self, field: str, field_type: str) -> Optional[str]:
329
329
if raw_log_field_pattern := self .raw_log_field_pattern_map .get (field_type ):
330
330
return raw_log_field_pattern .pattern .format (field = field )
331
331
332
- def process_raw_log_field_prefix (self , field : str , source_mapping : SourceMapping ) -> Optional [str ]:
333
- if self .raw_log_field_pattern_map is None :
334
- return
332
+ def process_raw_log_field_prefix (self , field : str , source_mapping : SourceMapping ) -> Optional [list ]:
333
+ if isinstance (field , list ):
334
+ list_of_prefix = []
335
+ for f in field :
336
+ if prepared_prefix := self .process_raw_log_field_prefix (field = f , source_mapping = source_mapping ):
337
+ list_of_prefix .extend (prepared_prefix )
338
+ return list_of_prefix
335
339
if raw_log_field_type := source_mapping .raw_log_fields .get (field ):
336
- return self .process_raw_log_field (field = field , field_type = raw_log_field_type )
340
+ return [ self .process_raw_log_field (field = field , field_type = raw_log_field_type )]
337
341
338
342
def generate_raw_log_fields (self , fields : list [Field ], source_mapping : SourceMapping ) -> str :
343
+ if self .raw_log_field_pattern_map is None :
344
+ return ""
339
345
defined_raw_log_fields = []
340
346
for field in fields :
341
347
mapped_field = source_mapping .fields_mapping .get_platform_field_name (generic_field_name = field .source_name )
@@ -347,7 +353,7 @@ def generate_raw_log_fields(self, fields: list[Field], source_mapping: SourceMap
347
353
if not mapped_field and self .is_strict_mapping :
348
354
raise StrictPlatformException (field_name = field .source_name , platform_name = self .details .name )
349
355
if field_prefix := self .process_raw_log_field_prefix (field = mapped_field , source_mapping = source_mapping ):
350
- defined_raw_log_fields .append (field_prefix )
356
+ defined_raw_log_fields .extend (field_prefix )
351
357
return "\n " .join (set (defined_raw_log_fields ))
352
358
353
359
def _generate_from_tokenized_query_container (self , query_container : TokenizedQueryContainer ) -> str :
0 commit comments