File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 16
16
*
17
17
*/
18
18
19
- use std:: sync:: Arc ;
20
-
21
19
use async_trait:: async_trait;
22
20
use futures_util:: StreamExt ;
23
21
use rdkafka:: consumer:: { CommitMode , Consumer } ;
24
22
use serde_json:: Value ;
23
+ use std:: collections:: HashMap ;
24
+ use std:: sync:: Arc ;
25
25
use tokio_stream:: wrappers:: ReceiverStream ;
26
26
use tracing:: { debug, error} ;
27
27
28
28
use crate :: {
29
29
connectors:: common:: processor:: Processor ,
30
30
event:: {
31
31
format:: { json, EventFormat , LogSourceEntry } ,
32
- Event as ParseableEvent ,
32
+ Event as ParseableEvent , USER_AGENT_KEY ,
33
33
} ,
34
34
parseable:: PARSEABLE ,
35
35
storage:: StreamType ,
@@ -76,6 +76,9 @@ impl ParseableSinkProcessor {
76
76
}
77
77
}
78
78
79
+ let mut p_custom_fields = HashMap :: new ( ) ;
80
+ p_custom_fields. insert ( USER_AGENT_KEY . to_string ( ) , "kafka" . to_string ( ) ) ;
81
+
79
82
let p_event = json:: Event :: new ( Value :: Array ( json_vec) ) . into_event (
80
83
stream_name. to_string ( ) ,
81
84
total_payload_size,
@@ -85,6 +88,7 @@ impl ParseableSinkProcessor {
85
88
time_partition. as_ref ( ) ,
86
89
schema_version,
87
90
StreamType :: UserDefined ,
91
+ & p_custom_fields,
88
92
) ?;
89
93
90
94
Ok ( p_event)
You can’t perform that action at this time.
0 commit comments