Sending Test Events

Step by step guide on sending test events to verify your RudderStack installation.

This guide assumes that you have already installed and set up RudderStack in your preferred environment.

You can follow any of the two approaches to send test events and verify your RudderStack installation:

  • Bundled shell script

  • RudderStack's HTTP API

Bundled shell script

The RudderStack GitHub repository contains a bundled shell script that generates test events. Clone the repository by running the following command:

git clone https://github.com/rudderlabs/rudder-server.git

Then, follow the steps below to send test events.

Step 1: Getting the source write key

RudderStack Open Source dashboard

If you have signed up for RudderStack Open Source, follow these steps to get the source write key:

  1. Set up a source and a destination in RudderStack.

  2. You can find the write key in the source details page, as shown:

Note that the write key is different from your workspace token. The write key is associated with the source, while the workspace token is associated with your RudderStack workspace, as seen below:

Self-hosted control plane

If you are self-hosting RudderStack and have set up the control plane using the Control Plane Lite utility, you can obtain the source write key by following these steps:

  1. Set up a source and a destination.

  2. Note the write key associated with the source in the dashboard as shown:

Step 2: Sending test events

To send the test events, follow the steps listed in the sections below depending on your preferred setup choice:

For local setup

  1. Navigate to the folder where RudderStack is installed.

  2. Then, run the following command after replacing <WRITE_KEY> with the source write key obtained in the previous section, and <DATA_PLANE_URL> with your data plane URL.

./scripts/generate-event <WRITE_KEY> <DATA_PLANE_URL>/v1/batch

An example is shown below:

For Docker setup

For a Dockerized setup, run the following command:

docker exec -ti \
    <rudder-server-running-container-id> \
    ./scripts/generate-event <WRITE_KEY> <DATA_PLANE_URL>/v1/batch

You can then check your destination to verify that the events are delivered.

Note that unlike RudderStack Open Source, the control plane set up using the Control Plane Lite utility does not let you view live events.

If you supply an invalid source write key or data plane URL, you will get the following error:

Using the HTTP API

To send test events via the RudderStack HTTP API, follow these steps:

  1. Import this Postman collection.

  2. Edit the variables source_write_key and data_plane_url in this collection with your source write key and your data plane URL.

RudderStack uses Basic Authentication for authenticating all the HTTP requests. The HTTP Basic Authentication requires a user name and password where:

  • The user name is the source_write_key

  • The password is an empty string ("")

Now you can send test API requests and verify if your installation is working as expected.

Contact us

If you come across any issues while sending test events to verify your RudderStack installation, you can contact us or start a conversation in our Slack community.

Last updated