user2205623
user2205623

Reputation: 41

delete property of event keen.io

Is there a way to delete a property of an event?

e.g. I have an event called Log which has a two properties X and Y

I wanted to delete X

If this cannot be done can I edit the values of X for event Log?

I have been unable to find anything online

Upvotes: 0

Views: 136

Answers (2)

jandwiches
jandwiches

Reputation: 487

You can delete just a certain property or particular properties from your Event Collection as shown here: https://keen.io/docs/api/#delete-a-property.

While in some cases you may want to delete erroneous or errant data, in other cases especially where you are not actively using and querying the data it is OK to leave the property there. It will appear in your historical data, but just don't continue to send the property in for future data points. There is a generous limit on the number of unique properties (1,000 unique properties) allowed per event as well as a large size limit on individual events as well (~1MB).

I’d recommend running an extraction of the exact same query first (https://keen.io/docs/api/#extractions) to get a preview of what you’re about to delete. That way you’ll also have successfully created a backup of that data as well.

Here's a sample CURL command for deletes for a particular property - use COLLECTION_NAME and PROPERTY_NAME to identify the property that you want to remove from your particular event collection. Of course, replace PROJECT_ID, COLLECTION_NAME, and MASTER_KEY placeholders with your own.

$ curl https://api.keen.io/3.0/projects/PROJECT_ID/events/COLLECTION_NAME/properties/PROPERTY_NAME \
    -H "Authorization: MASTER_KEY" \
    -H "Content-Type: application/json" \
    -X DELETE

Upvotes: 2

masojus
masojus

Reputation: 36

Take a look here at the API Docs. Have you tried sending a DELETE to https://api.keen.io/3.0/projects/PROJECT_ID/events/Log/properties/X or something along those lines? This will delete the property from all events in the collection.

Upvotes: 2

Related Questions