@@ -39,7 +39,7 @@ def setup(request):
39
39
def pytest_configure ():
40
40
# Generate message data
41
41
topics = [config ["kafka_topic" ], config ["kafka_topic_2" ], config ["kafka_header_topic" ],"prototopic" ,
42
- "test_splunk_hec_malformed_events" ,"epoch_format" ,"date_format" ]
42
+ "test_splunk_hec_malformed_events" ,"epoch_format" ,"date_format" , "record_key" ]
43
43
44
44
create_kafka_topics (config , topics )
45
45
producer = KafkaProducer (bootstrap_servers = config ["kafka_broker_url" ],
@@ -67,9 +67,9 @@ def pytest_configure():
67
67
('splunk.header.source' , b'kafka_custom_header_source' ),
68
68
('splunk.header.sourcetype' , b'kafka_custom_header_sourcetype' )]
69
69
producer .send (config ["kafka_header_topic" ], msg , headers = headers_to_send )
70
-
71
70
producer .send ("test_splunk_hec_malformed_events" , {})
72
71
producer .send ("test_splunk_hec_malformed_events" , {"&&" : "null" , "message" : ["$$$$****////" , 123 , None ]})
72
+ producer .send ("record_key" ,{"timestamp" : config ['timestamp' ]},b"{}" )
73
73
protobuf_producer .send ("prototopic" ,value = b'\x00 \x00 \x00 \x00 \x01 \x00 \n \x01 1\x12 \r 10-01-04-3:45\x18 \x15 %\x00 \x00 *C*\x02 No:\x12 \n \x01 1\x12 \x04 this\x1a \x07 New oneB\x0c \n \x01 1\x12 \x07 shampooJ\x04 Many' )
74
74
timestamp_producer .send ("date_format" ,b"{\" id\" : \" 19\" ,\" host\" :\" host-01\" ,\" source\" :\" bu\" ,\" fields\" :{\" hn\" :\" hostname\" ,\" CLASS\" :\" class\" ,\" cust_id\" :\" 000013934\" ,\" time\" : \" Jun 13 2010 23:11:52.454 UTC\" ,\" category\" :\" IFdata\" ,\" ifname\" :\" LoopBack7\" ,\" IFdata.Bits received\" :\" 0\" ,\" IFdata.Bits sent\" :\" 0\" }" )
75
75
timestamp_producer .send ("epoch_format" ,b"{\" id\" : \" 19\" ,\" host\" :\" host-01\" ,\" source\" :\" bu\" ,\" fields\" :{\" hn\" :\" hostname\" ,\" CLASS\" :\" class\" ,\" cust_id\" :\" 000013934\" ,\" time\" : \" 1555209605000\" ,\" category\" :\" IFdata\" ,\" ifname\" :\" LoopBack7\" ,\" IFdata.Bits received\" :\" 0\" ,\" IFdata.Bits sent\" :\" 0\" }" )
0 commit comments