Cassandra & DataStax Reporting

Cassandra is a leading distributed database manage system designed to handle large amounts of data. Knowi enables visualization, reporting automation and analysis of Cassandra data.

If you are not a current Knowi customer, visit our Instant Cassandra Reporting page to get started and sign up.

Cloud9Agent Configuration

Use Cloud9Agent inside your network to connect and extract data from Cassandra securely. See Cloud9Agent to download your agent along with instructions to run it.

The agent contains a datasource_example_cassandra.json and query_example_cassandra.json under the examples folder of the agent installation to get you started.

  • Edit those to point to your database and modify the queries to pull your data.
  • Move it into the config directory (datasource_XXX.json files first if the Agent is running).

Datasource Configuration:

Parameter Comments
name Unique Datasource Name.
datasource Set value to cassandra, or dataStax (for DataStax Cassandra implementation)
url URL to connect to, where applicable for the datasource, with host, port and keyspace. Example for Cassandra: localhost:9160/cloud9demo
userId User id to connect, where applicable.
Password Password, where applicable

Query Configuration:

Query Config Params Comments
entityName Dataset Name Identifier. Data for this query will be stored under the dataset in your Knowi warehouse.
identifier A unique identifier for the dataset. Either identifier or entityName must be specified.
dsName Name of the datasource name configured in the datasource_XXX.json file to execute the query against. Required.
queryStr Cassandra CQL query to execute. Required.
frequencyType One of minutes, hours, days,weeks,months. If this is not specified, this is treated as a one time query, executed upon Cloud9Agent startup (or when the query is first saved)
frequency Indicates the frequency, if frequencyType is defined. For example, if this value is 10 and the frequencyType is minutes, the query will be executed every 10 minutes
startTime Optional, can be used to specify when the query should be run for the first time. If set, the the frequency will be determined from that time onwards. For example, is a weekly run is scheduled to start at 07/01/2014 13:30, the first run will run on 07/01 at 13:30, with the next run at the same time on 07/08/2014. The time is based on the local time of the machine running the Agent. Supported Date Formats: MM/dd/yyyy HH:mm, MM/dd/yy HH:mm, MM/dd/yyyy, MM/dd/yy, HH:mm:ss,HH:mm,mm
c9QLFilter Optional post processing of the results using Cloud9QL. See Cloud9QL docs
overrideVals This enables data storage strategies to be specified. If this is not defined, the results of the query is added to the existing dataset. To replace all data for this dataset within Knowi, specify {"replaceAll":true}. To upsert data specify "replaceValuesForKey":["fieldA","fieldB"]. This will replace all existing records in Knowi with the same fieldA and fieldB with the the current data and insert records where they are not present.

Datasource Example:

[
  {
    "name":"demoCassandra",
    "url":"localhost:9160/cloud9demo",
    "datasource":"cassandra"
  },
  {
    "name":"demoDataStax",
    "url":"localhost:9042/cloud9demo",
    "datasource":"datastax"
  }
]

Query Examples:

[
  {
    "entityName":"Cassandra Demo",
    "dsName":"demoCassandra",
    "queryStr":"select sent, date from demo_data",
    "c9SQLFilter":"select sum(Sent) as Sent, date(date) as Date group by date(date) order by date asc",
    "overrideVals":{
      "replaceAll":true
    }
  },
  {
    "entityName":"Queues",
    "dsName":"demoCassandra",
    "queryStr":"select Name, size as 'Queue Size', Type from queue",
    "overrideVals":{
      "replaceValuesForKey":["Type"]
    },
    "startTime":"07:20",
    "frequencyType":"daily",
    "frequency":1
  }
]

The first query is run once and replaces all data for that dataset in Knowi. The second is run once a day at 07:20 AM and updates all existing data with the same Type field, or inserts new records otherwise.