@@ -16,7 +16,9 @@ use crate::protocol::{
1616 Frame , IpAddr , Level , LogEntry , Request , Stacktrace , Tags , User ,
1717} ;
1818use crate :: store:: { GeoIpLookup , StoreConfig } ;
19- use crate :: types:: { Annotated , Empty , Error , ErrorKind , Meta , Object , ValueAction } ;
19+ use crate :: types:: {
20+ Annotated , Empty , Error , ErrorKind , FromValue , Meta , Object , Value , ValueAction ,
21+ } ;
2022
2123mod contexts;
2224mod logentry;
@@ -293,12 +295,13 @@ impl<'a> Processor for NormalizeProcessor<'a> {
293295 event. key_id = Annotated :: from ( self . config . key_id . clone ( ) ) ;
294296 event. ty = Annotated :: from ( self . infer_event_type ( event) ) ;
295297 event. version = Annotated :: from ( self . config . protocol_version . clone ( ) ) ;
296- event. grouping_config = Annotated :: from (
297- self . config
298- . grouping_config
299- . as_ref ( )
300- . map ( |x| x. as_grouping_config ( ) ) ,
301- ) ;
298+ event. grouping_config = self
299+ . config
300+ . grouping_config
301+ . clone ( )
302+ . map_or ( Annotated :: empty ( ) , |x| {
303+ FromValue :: from_value ( Annotated :: < Value > :: from ( x) )
304+ } ) ;
302305
303306 // Validate basic attributes
304307 event. platform . apply ( |platform, _| {
@@ -542,7 +545,6 @@ impl<'a> Processor for NormalizeProcessor<'a> {
542545use crate :: {
543546 processor:: process_value,
544547 protocol:: { PairList , TagEntry } ,
545- types:: Value ,
546548} ;
547549
548550#[ cfg( test) ]
@@ -1179,9 +1181,9 @@ fn test_discards_received() {
11791181#[ test]
11801182fn test_grouping_config ( ) {
11811183 use crate :: protocol:: LogEntry ;
1182- use crate :: store:: StoreGroupingConfig ;
11831184 use crate :: types:: SerializableAnnotated ;
11841185 use insta:: assert_ron_snapshot_matches;
1186+ use serde_json:: json;
11851187
11861188 let mut event = Annotated :: new ( Event {
11871189 logentry : Annotated :: from ( LogEntry {
@@ -1193,9 +1195,9 @@ fn test_grouping_config() {
11931195
11941196 let mut processor = NormalizeProcessor :: new (
11951197 Arc :: new ( StoreConfig {
1196- grouping_config : Some ( StoreGroupingConfig {
1197- id : "legacy:1234-12-12" . into ( ) ,
1198- } ) ,
1198+ grouping_config : Some ( json ! ( {
1199+ "id" : "legacy:1234-12-12" . to_string ( ) ,
1200+ } ) ) ,
11991201 ..Default :: default ( )
12001202 } ) ,
12011203 None ,
0 commit comments