Torch Log Service
Rule | Description |
Basic logic | TLS executes each statement defined in the rule sequentially and processes every function in the statements based on semantic order. Each function modifies the log event during execution and returns the processed event. For example, f_set("user_type", "normal") adds a field user_type with value normal to every event. The next function receives the event after the new user_type field has been added. |
Conditional judgment | The data transformation rules allow setting conditions for each step. Only events that meet these conditions will trigger the corresponding function execution. For example, in the statement c_if(f_has("inner_user"), f_set("user_source", "inner")), TLS first checks whether the field inner_user exists. If it does not exist, no action is taken. If it exists, a new field user_source will be added with the value set to inner. |
Output | If the specified condition is met, the data is output; if not, no action will be taken. If no other rule processes the event, it will be deleted afterwards. For example, c_if(op_eq(v("user_city"), "chengdu"), e_output("target")). If the value of user_city is chengdu, the event will be output to the log topic with the alias target. |