Skip to content

Using our C SDK Sample Program

Beta Feature

This feature is in beta stage and subject to change.

This section describes how to use our sample c program, available on Nexus, to send the data from the sample.csv file to the sdk_sample_assembly inside kdb Insights Enterprise. You can download this assembly using the instructions here.


If you would like to try the C SDK sample program please contact KX Support using the KX Support Portal. It will be available soon from the kdb Insights Nexus registry.

The C SDK kxi-c-sdk-samples-${VERSION}.zip contains the following files:

  • csvupload.c - csv upload source code
  • CMakeLists.txt - cmake file
  • sample.csv - a CSV file containing sample data based on the sdk-sample-assembly schema


Before using the sample program you must download and extract the C SDK.

You can use the source code for the sample program in your applications.


​ Build the sample program as follows: ​

$ unzip kxi-c-sdk-${VERSION}.zip && unzip kxi-c-sdk_samples-${VERSION}.zip
$ mkdir samples/build && cd samples/build
$ cmake .. -DKXI_C_SDK_INCLUDE_DIR:PATH=../kxi_c_sdk/include -DKXI_C_SDK_LINK_DIR:PATH=../kxi_c_sdk && cmake --build .
​ This generates an executable csvupload (extensions will vary depending on the platform). ​ ​

Application parameters

The application parameters are defined as follows:

parameter required default description
-u str Mandatory none Authenticated SDK client URL
-s str Mandatory none Schema - see note below.
-t str Mandatory none Table (for example: "trace")
-r str Optional /tmp/rt RT directory
-f int Optional 5000 Time in ms to sleep between reads of the configuration details.
-c int Optional 300000 Maximum age of configuration details in milliseconds. After this amount of time, if still unable to fetch a new configuration, the connection is considered to be broken and any subsequent attempts to send data to kdb Insights Enterprise will fail with a Not connected error. This is only needed when using the kdb Insights Enterprise Information Service to obtain the configuration details.
-l int Optional 600000 Local persistence period (in milliseconds)
-g str Optional info Log Level (example: "info")
-m str Optional err Console log level (info/warn/err/off)
-w num Optional 2000 Milliseconds to wait for the connection to establish
-i str Optional stdin Used to set an input file name, rather than stdin, eg. '../sample.csv'
-o int Optional 1 Send the file a specific number of many times, -1 for infinite loop
-z int Optional 0 Set to 1 to write a single test record


  • s str: The schema must match that defined in the pipeline assembly. For schema in the table matches the one in the sdk_sample_assembly, described here, the schema definition is as follows: sensorID:int,captureTS:ts,readTS:ts,valFloat:float,qual:int,alarm:int

Publishing data

The example below runs the csvupload program from the command line. It sets the mandatory parameters and uses defaults for the rest:

./csvupload -u $url -s $schema -t $table < ../sample.csv

Supported data types

The following data types are supported by the sample application:

type schema notation example
string string name
symbol symbol LLOY
int int 1
byte byte 0
long long 200000
float float 1.2345
timestamp ts 2000.01.01D00:00:00.000000000