Skip to main content

Samples and previews

tip

For message ingestion, first check parsing and mapping with small samples: inspect the parsing preview, then the mapping preview, and finally send real messages and query the target. Previews do not send messages to the source or replace verification of task consumption and target writes. One passing sample does not mean other messages can be processed.

Where to operate: taosExplorer → Data Ingestion → Kafka or MQTT task configuration → Payload parsing. Check actual ingestion in the taosExplorer Data Browser or taos CLI.

A sample is a small input used to check parsing and mapping. A preview shows its results after parsing and mapping.

1. Prepare inputs that can be checked​

First confirm the actual reading host, source permissions, target database, and test topic following the Common ingestion workflow. Prefer redacted real messages with the same structure as actual business data.

{"device":"d001","ts":1795132800000,"temperature":23.5}

device is the device identifier; ts is a millisecond Unix timestamp corresponding to 2026-11-20T00:00:00Z; temperature is a numeric value. For actual writes, this time must fall within source and target retention. After changing the time, update sent messages and verification queries together, not just the preview sample.

Prepare at least the following additional inputs. Preview each separately and record the expected result:

SampleWhat to check
device=d002, time increased by 1000 millisecondsWhether another device's child table is generated and the time is correct.
Temperature 0 or negativeWhether it is incorrectly treated as null and whether it meets filtering rules.
Missing deviceWhether the child table template can generate a valid name. It must not silently merge data into another device.
Missing ts or wrong time unitWhether it fails explicitly or follows the approved error policy.
Temperature as a string or nullWhether type conversion and null behavior match the target model.

2. Obtain samples and preview​

  1. For production ingestion preparation or server retrieval, first finish source connection and collection object settings, then check connectivity. With an authorized redacted sample, enter or upload it directly to check parsing rules only. This does not establish a successful source connection.
  2. In the Payload parsing area, select Retrieve from Server, File Upload, or enter the Message Body directly. Retrieval requires source access from the actual reading host. An uploaded file is only preview input and does not create a file import task.
  3. Select JSON parsing without adding extraction or filtering rules yet.
  4. Click the magnifying glass to the right of the parsing row. Wait for field names to appear, then hover over the magnifying glass to inspect the Preview Parsing Results table. If it is too narrow, click the expand icon at its upper right to view all columns in the expanded panel; close the panel to return to configuration. Confirm expected fields, row counts, and values only. Seeing column names alone does not mean every row has been checked. After changing a sample or rule, click again and inspect the new results instead of reusing the previous preview.
  5. After configuring the target supertable, child table name, columns, and tags, inspect the mapping preview. Parsing and mapping previews check different stages; both must pass.

If source messages have multiple structures, save samples by category and check each corresponding rule block's matching and output. One passing sample does not mean every message in the topic can be processed.

Payload sample input, retrieval, upload, and clear controls

The Maximum sample rows in the image is 5. It controls samples for this preview, not the production task's read batch or the target's total row limit. The Kafka interface allows up to 100; check other connectors' respective interfaces. Previewing five rows does not establish that other messages have the same format. Retrieve from Server and File Upload both append to current samples. To replace them, first save the redacted original, then click Clear, or old and new samples may be mixed. Check the connector guide for retrieval's effects on source positions or acknowledgements. If an authorized sample is available, paste it directly; there is no need to read a production subscription again for a preview.

2.1 File samples for Kafka JSON messages​

Kafka's json parsing interface accepts UTF-8 text with one complete JSON object per line. Save the following as kafka-temperature-samples.jsonl, or use the supplied sample file with the same content. The file has two lines. Do not add a value header, quote entire lines using CSV rules, or escape double quotes by doubling them:

{"device":"d001","ts":1795132800000,"temperature":23.5}
{"device":"d001","ts":1795132801000,"temperature":24.5}
  1. To replace existing samples, first save the redacted original and click Clear. Uploads append to the current input.
  2. Click File Upload, select the file above, then select json and run a parsing preview.
  3. Expect two rows, both for device d001, with temperatures 23.5 and 24.5 and timestamps 1000 milliseconds apart. Then check target table names, types, and tags using Minimal mapping.

Kafka file sample parsing shows two temperature records

For the json parser, organize file contents as line-delimited JSON above. A .csv extension does not mean tabular content with headers or CSV escaping is accepted. Configure other parsers and connectors according to their input conventions. Uploading and previewing do not produce Kafka messages. The production task must still read real messages from the topic.

3. Interpret results one item at a time​

LocationExpected in this exampleNext step if different
Parsing resultsOne row with three business fields and temperature 23.5.First check original text, encoding, and parser; do not modify business tables first.
Time mappingConverts ts in milliseconds to the primary timestamp column.Compare original units and display time zone; rule out mixed seconds and milliseconds.
Table nameTemplate t_{device} generates t_d001.Check referenced template fields, null values, and invalid characters.
Columns and tagsTemperature goes to a numeric column; device goes to a tag.Check target table selection and field mapping, not just similar column names.
Rule changesAdd only one rule category at a time and record output before and after.Return to the last working stage to locate the issue. Do not change the source connection and model together.
warning

Field defaults can hide missing inputs. Confirm their business meaning before use and test samples with missing fields. Do not set device identifiers and business times to constants or the current time merely to pass the preview.

4. Verify ingestion with real messages​

Create taosx_quickstart.temperatures following Write your first record from Kafka, mapping it to child table t_d001. Start the task and send the messages above to the actual test topic. Run in the taosExplorer Data Browser or taos CLI:

SELECT ts, temperature, device
FROM taosx_quickstart.t_d001
WHERE ts = 1795132800000;

Expect one row with temperature 23.5 and tag d001. Send another message with time 1000 milliseconds later and temperature 24.5, then query the new timestamp to confirm continuous writing. Client time zones affect displayed time text; compare the same timestamp.

5. Troubleshooting​

SymptomCheck order
No samples retrievedConfirm source data, topic, and permissions, then check consumer position and reading host network.
Manual input previews successfully but retrieved data failsCompare original text, encoding, and compression settings, and check for different topics.
Parsing has rows but mapping does notCheck rule block matching, filters, time conversion, and table names. Do not repeatedly change connection addresses.
All previews are correct but the target has no dataConfirm that real messages were sent and the task started, then check target permissions and write errors. See No data on first ingestion.

6. Save and verify again​

Before changing an existing task, record the original configuration, samples, and verification queries. Stop the original task under the maintenance procedure if necessary. After saving, start the original task and verify with a new, recognizable message instead of merely reopening an old preview. Recovery positions depend on the connector and original task state. See Restarts, checkpoints, and store-and-forward.

7. Limitations​

This page covers only ingestion interfaces with message parsing previews; not all connectors have the same controls. Previews do not check all production data, sustained throughput, or rereading after downtime. Verify these separately through small-scope real data paths and maintenance drills.