Preparing Your File
Once you've established a place to put your data in Cogynt, the next step is to prepare your file for processing. Here, you'll tell Cogynt how to recognize and read your data by:
- Providing your data in a JSON file.
- Analyzing the file for relevant fields.
- Creating a schema to confirm the fields to use.
These procedures are described in greater detail under the corresponding topic headings.
Upload a JSON File
Cogynt's Data Management Tool provides several options to easily upload data into Kafka. For the purpose of this guide, you'll use the tool's GUI to upload a JSON to Kafka.
To upload your JSON file:
- Open Data Management Tool.
- On the landing page, click Data File Upload.
- From the Select Project dropdown menu, select the project you created earlier.
- From the Select Topic dropdown menu, select the topic you created earlier.
- From the Select Deployment Target dropdown menu, select the deployment target you created earlier.
- Under Data File, either drag your JSON file to the space indicated on the page, or click the space to browse for and select your JSON file.
- Inspect the preview to confirm that the uploaded file matches what you expected.
- Click Upload.
- In the Confirm Data File Upload dialog, click Upload.
Discover a Schema
Cogynt Authoring's Schema Discovery utility expedites the creation of models by providing data schemas that are pre-populated with relevant values based on your data. In this step, you'll use the utility to analyze your data. The utility will then suggest possible schemas for you to use.
To discover a schema using Schema Discovery:
- Click the system panel (☰) icon.
- In the Other Tasks menu, click Schema Discovery.
- In the Schema Discovery window:
- From the Project dropdown menu, select your project. (The current project is selected by default.)
- From the Kafka Broker dropdown menu, select the Kafka broker for the external Kafka namespace where your data is stored.
- In the Host field, specify the host of the Kafka cluster where your data is stored.
- In the Port field, specify the port of the Kafka cluster where your data is stored.
- Click Discover.
Once it has processed your data, Authoring returns a list of discovered topics. Next, you'll use that list to create your schema and tell Cogynt how to recognize and deal with your data.
Create a Schema
The Discovered Topics list provides all the necessary tools to put together a schema of your own.
To create a schema using the list of discovered topics:
- In the Discovered Topics list, click a relevant topic. The Data Schema window opens, pre-populated with the topic's data schema.
- In the Data Schema window:
- Verify the information in the Name and Path fields for each schema item. If necessary, enter new values in each field. Check the Sync path to name checkbox if you want both fields to contain identical entries as you type.
- Click Sample Data to display or hide what a sample of what each schema item's data looks like.
- Click Add Field (+) to add a new field. For more information on adding fields, refer to Adding Fields to User Data Schemas in the Cogynt Authoring User Guide.
- Click the Delete (trash can) button on the right of each unnecessary schema item to remove it.
- Click and drag the dotted drag handle on the right of field to reposition it in the list of fields.
- When finished, click Create User Data Schema to save the schema, or click Clear to discard the schema. (Note: The Create User Data Schema button is enabled only if a project is selected.)
- Repeat steps 1-2 as needed for each relevant topic in the Discovered Topics list.
Once your schema is ready, all of the file preparations are complete. The next task is to define the logic that Cogynt should use to process your data.