Sending Test Events

This guide assumes you have already installed and set up RudderStack.

There are two ways in which you can send test events to verify your RudderStack installation:

  • Using the bundled shell script
  • Using RudderStack's HTTP API

Bundled Shell Script

In our GitHub repository, we have bundled a shell script that generates test events. Follow the steps below:

Clone the Repository

Before sending test events to verify your RudderStack installation, clone the RudderStack GitHub repository by running the following command:

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

Then, follow the sections below to send events to test your RudderStack installation.

Get the Source Write Key

Option 1: If you have signed up for RudderStack Cloud, follow these steps to get your source write key:

  • Set up a source and a destination in RudderStack by following this guide.
  • You can find the write key in the dashboard, as shown:
screen shot 2021 07 01 at 5 27 53 pm

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.

screen shot 2021 07 01 at 5 29 03 pm

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

  • Set up a source and a destination by following this guide.
  • You can find the write key associated with the source in the dashboard as shown:
Write Key

Send Test Events

Option 1: If you're using RudderStack Cloud, follow these steps:

  • In your terminal, navigate to the folder where RudderStack is installed.
  • Then, run the following command after replacing <YOUR_WRITE_KEY> with the source write key obtained in the previous section:
./scripts/generate-event <YOUR_WRITE_KEY> https://hosted.rudderlabs.com/v1/batch
  • You can then check your destination to verify that events are delivered. You can also view the live events via RudderStack's Live Events tab.

Option 2: If you have set up open-source RudderStack in your environment, follow these steps:

  • In your terminal, navigate to the folder where RudderStack is installed.
  • Then, run the following command after replacing <YOUR_WRITE_KEY> with the source write key obtained in the previous section, and <DATA_PLANE_URL> with your Data Plane URL.
./scripts/generate-event <YOUR_WRITE_KEY> <DATA_PLANE_URL>/v1/batch

An example is as shown:

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

Note that unlike RudderStack Cloud, the Control Plane set up using the open-source Control Plane Lite 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:

error

Using the HTTP API

  • Import this Postman collection.
  • Edit the variables source_write_key and data_plane_url in this collection with your source write key and your RudderStack 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 test all the supported requests.

Getting the Source Write Key

If you have signed up for RudderStack Cloud, follow these steps to get your source write key:

  • Set up a source in RudderStack by following this guide.
  • You can find the write key in the dashboard, as shown:
screen shot 2021 07 01 at 5 27 53 pm

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.

screen shot 2021 07 01 at 5 29 03 pm

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

  • Set up a source by following this guide.
  • You can find the write key associated with the source in the dashboard as shown:
writekey

Getting the Data Plane URL

Follow this section for details on how to get your Data Plane URL.

Refer to the HTTP API guide for more information on the supported calls.

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 on our Slack channel.