As Alooma receives events from your inputs, the Code Engine allows you to transform whichever events you choose before they are propagated to your target data warehouse.
There are several scenarios where transforming events on the fly with the Code Engine can be useful:
- Cleansing values that are represented differently in a database; for example changing values of 0 or 1 to false or true, or rounding floats to integers.
- Enriching data with the results of lookups from other sources, such as Geo-IP resolution.
- Discarding undesired events.
- Splitting up a single event into multiple events across different database tables, in order to make the data more modular and easily queryable.
- Generating notifications.
- Gathering metrics on incoming data.
The Code Engine is actually an in-browser Python (2.7) environment. This environment is a lightweight IDE for you to provide data transformation code for received events. By default, the transform function simply returns the received
def transform(event): return event
event object is a standard Python dictionary, whose keys and values are populated by the input source that sent the event. Fields in the object can be accessed with
event object can be modified to your liking - fields can be added, modified, or removed.
Those are the basics - read on to learn about the Code Engine's features mentioned above.