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 1616 *
1717 */
1818
19- use std:: sync:: Arc ;
20-
2119use async_trait:: async_trait;
2220use futures_util:: StreamExt ;
2321use rdkafka:: consumer:: { CommitMode , Consumer } ;
2422use serde_json:: Value ;
23+ use std:: collections:: HashMap ;
24+ use std:: sync:: Arc ;
2525use tokio_stream:: wrappers:: ReceiverStream ;
2626use tracing:: { debug, error} ;
2727
2828use crate :: {
2929 connectors:: common:: processor:: Processor ,
3030 event:: {
3131 format:: { json, EventFormat , LogSourceEntry } ,
32- Event as ParseableEvent ,
32+ Event as ParseableEvent , USER_AGENT_KEY ,
3333 } ,
3434 parseable:: PARSEABLE ,
3535 storage:: StreamType ,
@@ -76,6 +76,9 @@ impl ParseableSinkProcessor {
7676 }
7777 }
7878
79+ let mut p_custom_fields = HashMap :: new ( ) ;
80+ p_custom_fields. insert ( USER_AGENT_KEY . to_string ( ) , "kafka" . to_string ( ) ) ;
81+
7982 let p_event = json:: Event :: new ( Value :: Array ( json_vec) ) . into_event (
8083 stream_name. to_string ( ) ,
8184 total_payload_size,
@@ -85,6 +88,7 @@ impl ParseableSinkProcessor {
8588 time_partition. as_ref ( ) ,
8689 schema_version,
8790 StreamType :: UserDefined ,
91+ & p_custom_fields,
8892 ) ?;
8993
9094 Ok ( p_event)
You can’t perform that action at this time.
0 commit comments