If you are you not running source connectors to produce events, you can use ksqlDB INSERT INTO
statements to insert mock data into the source topics:
INSERT INTO audit_log_events (id, source, specversion, type, time, datacontenttype, subject, confluentrouting, data) VALUES('889bdcd9-a378-4bfe-8860-180ef8efd208', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', '1.0', 'io.confluent.kafka.server/authorization', '2019-10-24T16:15:48.355Z', 'application/json', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', STRUCT(route := 'confluent-audit-log-events'), STRUCT(serviceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', methodName := 'kafka.CreateTopics', resourceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', authenticationInfo := STRUCT(principal := 'User:admin'), authorizationInfo := STRUCT(granted := true, operation := 'Create', resourceType := 'Topic', resourceName := 'app3-topic', patternType := 'LITERAL', superUserAuthorization := true), request := STRUCT(correlation_id := '3', client_id := 'adminclient-6'), requestMetadata := STRUCT(client_address := '/127.0.0.1')));
INSERT INTO audit_log_events (id, source, specversion, type, time, datacontenttype, subject, confluentrouting, data) VALUES('889bdcd9-a378-4bfe-8860-180ef8efd209', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', '1.0', 'io.confluent.kafka.server/authorization', '2019-10-24T17:16:43.355Z', 'application/json', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', STRUCT(route := 'confluent-audit-log-events'), STRUCT(serviceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', methodName := 'kafka.CreateTopics', resourceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', authenticationInfo := STRUCT(principal := 'User:admin'), authorizationInfo := STRUCT(granted := true, operation := 'Create', resourceType := 'Broker', resourceName := 'app3-topic', patternType := 'LITERAL', superUserAuthorization := true), request := STRUCT(correlation_id := '3', client_id := 'adminclient-6'), requestMetadata := STRUCT(client_address := '/127.0.0.1')));
INSERT INTO audit_log_events (id, source, specversion, type, time, datacontenttype, subject, confluentrouting, data) VALUES('889bdcd9-a378-4bfe-8860-180ef8efd206', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', '1.0', 'io.confluent.kafka.server/authorization', '2019-10-25T18:17:32.355Z', 'application/json', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', STRUCT(route := 'confluent-audit-log-events'), STRUCT(serviceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', methodName := 'kafka.CreateTopics', resourceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', authenticationInfo := STRUCT(principal := 'User:admin'), authorizationInfo := STRUCT(granted := true, operation := 'Delete', resourceType := 'Topic', resourceName := 'app4-topic', patternType := 'LITERAL', superUserAuthorization := true), request := STRUCT(correlation_id := '3', client_id := 'adminclient-8'), requestMetadata := STRUCT(client_address := '/127.0.0.1')));
INSERT INTO audit_log_events (id, source, specversion, type, time, datacontenttype, subject, confluentrouting, data) VALUES('889bdcd9-a378-4bfe-8860-180ef8efd205', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', '1.0', 'io.confluent.kafka.server/authorization', '2019-10-25T19:18:21.355Z', 'application/json', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', STRUCT(route := 'confluent-audit-log-events'), STRUCT(serviceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', methodName := 'kafka.CreateTopics', resourceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', authenticationInfo := STRUCT(principal := 'User:admin'), authorizationInfo := STRUCT(granted := true, operation := 'Create', resourceType := 'Topic', resourceName := 'app5-topic', patternType := 'LITERAL', superUserAuthorization := true), request := STRUCT(correlation_id := '3', client_id := 'adminclient-6'), requestMetadata := STRUCT(client_address := '/127.0.0.1')));
INSERT INTO audit_log_events (id, source, specversion, type, time, datacontenttype, subject, confluentrouting, data) VALUES('889bdcd9-a378-4bfe-8860-180ef8efd204', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', '1.0', 'io.confluent.kafka.server/authorization', '2019-10-26T20:19:33.355Z', 'application/json', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', STRUCT(route := 'confluent-audit-log-events'), STRUCT(serviceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', methodName := 'kafka.CreateTopics', resourceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', authenticationInfo := STRUCT(principal := 'User:admin'), authorizationInfo := STRUCT(granted := true, operation := 'Delete', resourceType := 'Topic', resourceName := 'app9-topic', patternType := 'LITERAL', superUserAuthorization := true), request := STRUCT(correlation_id := '3', client_id := 'adminclient-5'), requestMetadata := STRUCT(client_address := '/127.0.0.1')));
INSERT INTO audit_log_events (id, source, specversion, type, time, datacontenttype, subject, confluentrouting, data) VALUES('889bdcd9-a378-4bfe-8860-180ef8efd203', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', '1.0', 'io.confluent.kafka.server/authorization', '2019-10-26T21:20:34.355Z', 'application/json', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', STRUCT(route := 'confluent-audit-log-events'), STRUCT(serviceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', methodName := 'kafka.CreateTopics', resourceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', authenticationInfo := STRUCT(principal := 'User:admin'), authorizationInfo := STRUCT(granted := true, operation := 'Modify', resourceType := 'Topic', resourceName := 'app5-topic', patternType := 'LITERAL', superUserAuthorization := true), request := STRUCT(correlation_id := '3', client_id := 'adminclient-6'), requestMetadata := STRUCT(client_address := '/127.0.0.1')));
INSERT INTO audit_log_events (id, source, specversion, type, time, datacontenttype, subject, confluentrouting, data) VALUES('889bdcd9-a378-4bfe-8860-180ef8efd202', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', '1.0', 'io.confluent.kafka.server/authorization', '2019-10-24T16:15:12.355Z', 'application/json', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', STRUCT(route := 'confluent-audit-log-events'), STRUCT(serviceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', methodName := 'kafka.CreateTopics', resourceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', authenticationInfo := STRUCT(principal := 'User:admin'), authorizationInfo := STRUCT(granted := true, operation := 'Create', resourceType := 'Broker', resourceName := 'app3-topic', patternType := 'LITERAL', superUserAuthorization := true), request := STRUCT(correlation_id := '3', client_id := 'adminclient-6'), requestMetadata := STRUCT(client_address := '/127.0.0.1')));
INSERT INTO audit_log_events (id, source, specversion, type, time, datacontenttype, subject, confluentrouting, data) VALUES('889bdcd9-a378-4bfe-8860-180ef8efd201', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', '1.0', 'io.confluent.kafka.server/authorization', '2019-10-24T16:15:16.355Z', 'application/json', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', STRUCT(route := 'confluent-audit-log-events'), STRUCT(serviceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', methodName := 'kafka.CreateTopics', resourceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', authenticationInfo := STRUCT(principal := 'User:admin'), authorizationInfo := STRUCT(granted := true, operation := 'Create', resourceType := 'Broker', resourceName := 'app3-topic', patternType := 'LITERAL', superUserAuthorization := true), request := STRUCT(correlation_id := '3', client_id := 'adminclient-6'), requestMetadata := STRUCT(client_address := '/127.0.0.1')));
INSERT INTO audit_log_events (id, source, specversion, type, time, datacontenttype, subject, confluentrouting, data) VALUES('889bdcd9-a378-4bfe-8860-180ef8efd200', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', '1.0', 'io.confluent.kafka.server/authorization', '2019-10-24T16:15:17.355Z', 'application/json', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', STRUCT(route := 'confluent-audit-log-events'), STRUCT(serviceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', methodName := 'kafka.CreateTopics', resourceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', authenticationInfo := STRUCT(principal := 'User:admin'), authorizationInfo := STRUCT(granted := true, operation := 'Create', resourceType := 'Broker', resourceName := 'app3-topic', patternType := 'LITERAL', superUserAuthorization := true), request := STRUCT(correlation_id := '3', client_id := 'adminclient-6'), requestMetadata := STRUCT(client_address := '/127.0.0.1')));
INSERT INTO audit_log_events (id, source, specversion, type, time, datacontenttype, subject, confluentrouting, data) VALUES('889bdcd9-a378-4bfe-8860-180ef8efd218', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', '1.0', 'io.confluent.kafka.server/authorization', '2019-10-24T16:15:48.355Z', 'application/json', 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', STRUCT(route := 'confluent-audit-log-events'), STRUCT(serviceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q', methodName := 'kafka.CreateTopics', resourceName := 'crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic', authenticationInfo := STRUCT(principal := 'User:admin'), authorizationInfo := STRUCT(granted := true, operation := 'Create', resourceType := 'Broker', resourceName := 'app3-topic', patternType := 'LITERAL', superUserAuthorization := true), request := STRUCT(correlation_id := '3', client_id := 'adminclient-6'), requestMetadata := STRUCT(client_address := '/127.0.0.1')));
To validate that this recipe is working, run the following query:
SELECT * FROM audit_log_topics EMIT CHANGES LIMIT 5;
Your output should resemble:
+---------------------------------------------------------------------------+---------------------------------------------------------------------------+
|TIME |DATA |
+---------------------------------------------------------------------------+---------------------------------------------------------------------------+
|2019-10-24T16:15:48.355Z |{SERVICENAME=crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q, METHODNAME=kafka.CreateTo|
| |pics, RESOURCENAME=crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic, AU|
| |THENTICATIONINFO={PRINCIPAL=User:admin}, AUTHORIZATIONINFO={GRANTED=true, O|
| |PERATION=Create, RESOURCETYPE=Topic, RESOURCENAME=app3-topic, PATTERNTYPE=L|
| |ITERAL, SUPERUSERAUTHORIZATION=true}, REQUEST={CORRELATION_ID=3, CLIENT_ID=|
| |adminclient-6}, REQUESTMETADATA={CLIENT_ADDRESS=/127.0.0.1}} |
|2019-10-25T18:17:32.355Z |{SERVICENAME=crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q, METHODNAME=kafka.CreateTo|
| |pics, RESOURCENAME=crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic, AU|
| |THENTICATIONINFO={PRINCIPAL=User:admin}, AUTHORIZATIONINFO={GRANTED=true, O|
| |PERATION=Delete, RESOURCETYPE=Topic, RESOURCENAME=app4-topic, PATTERNTYPE=L|
| |ITERAL, SUPERUSERAUTHORIZATION=true}, REQUEST={CORRELATION_ID=3, CLIENT_ID=|
| |adminclient-8}, REQUESTMETADATA={CLIENT_ADDRESS=/127.0.0.1}} |
|2019-10-26T20:19:33.355Z |{SERVICENAME=crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q, METHODNAME=kafka.CreateTo|
| |pics, RESOURCENAME=crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic, AU|
| |THENTICATIONINFO={PRINCIPAL=User:admin}, AUTHORIZATIONINFO={GRANTED=true, O|
| |PERATION=Delete, RESOURCETYPE=Topic, RESOURCENAME=app9-topic, PATTERNTYPE=L|
| |ITERAL, SUPERUSERAUTHORIZATION=true}, REQUEST={CORRELATION_ID=3, CLIENT_ID=|
| |adminclient-5}, REQUESTMETADATA={CLIENT_ADDRESS=/127.0.0.1}} |
|2019-10-26T21:20:34.355Z |{SERVICENAME=crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q, METHODNAME=kafka.CreateTo|
| |pics, RESOURCENAME=crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic, AU|
| |THENTICATIONINFO={PRINCIPAL=User:admin}, AUTHORIZATIONINFO={GRANTED=true, O|
| |PERATION=Modify, RESOURCETYPE=Topic, RESOURCENAME=app5-topic, PATTERNTYPE=L|
| |ITERAL, SUPERUSERAUTHORIZATION=true}, REQUEST={CORRELATION_ID=3, CLIENT_ID=|
| |adminclient-6}, REQUESTMETADATA={CLIENT_ADDRESS=/127.0.0.1}} |
|2019-10-25T19:18:21.355Z |{SERVICENAME=crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q, METHODNAME=kafka.CreateTo|
| |pics, RESOURCENAME=crn:///kafka=8caBa-0_Tu-2k3rKSxY64Q/topic=app3-topic, AU|
| |THENTICATIONINFO={PRINCIPAL=User:admin}, AUTHORIZATIONINFO={GRANTED=true, O|
| |PERATION=Create, RESOURCETYPE=Topic, RESOURCENAME=app5-topic, PATTERNTYPE=L|
| |ITERAL, SUPERUSERAUTHORIZATION=true}, REQUEST={CORRELATION_ID=3, CLIENT_ID=|
| |adminclient-6}, REQUESTMETADATA={CLIENT_ADDRESS=/127.0.0.1}} |
Limit Reached
Query terminated