@@ -39,7 +39,7 @@ def setup(request):
3939def pytest_configure ():
4040 # Generate message data
4141 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" ]
4343
4444 create_kafka_topics (config , topics )
4545 producer = KafkaProducer (bootstrap_servers = config ["kafka_broker_url" ],
@@ -67,9 +67,9 @@ def pytest_configure():
6767 ('splunk.header.source' , b'kafka_custom_header_source' ),
6868 ('splunk.header.sourcetype' , b'kafka_custom_header_sourcetype' )]
6969 producer .send (config ["kafka_header_topic" ], msg , headers = headers_to_send )
70-
7170 producer .send ("test_splunk_hec_malformed_events" , {})
7271 producer .send ("test_splunk_hec_malformed_events" , {"&&" : "null" , "message" : ["$$$$****////" , 123 , None ]})
72+ producer .send ("record_key" ,{"timestamp" : config ['timestamp' ]},b"{}" )
7373 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' )
7474 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\" }" )
7575 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