Bulk Loading Guide
Import historical events from CSV or JSON
Import historical events from CSV or JSON via command line with keen-cli.
- Follow the instructions in the keen-cli README.md.
- Once you upload your data, verify if it was successful by viewing the Streams Manager in your Keen IO project console.
Here’s an example command that adds events from a CSV file into a Keen IO collection called “signups”.
$ keen events:add --collection signups --file events.csv --csv
Load Historical Data Programmatically
There are a few options for loading your historical event data programatically:
- Use the
publish_batchmethod in the Keen IO Ruby Client
- Use the
add_eventsmethod in the Keen IO Python Client
Tips for bulk loading:
- Make sure you set the keen.timestamp property to your historical event’s timestamp. Otherwise Keen IO will assume your event happened at the time you posted it.
- We recommend posting in batches of 5,000 events or smaller.