Route Logs in a Branched Pipeline
3 minute read
Overview
The Route node in Edge Delta functions as a conditional traffic director within a log processing pipeline. This node evaluates specified conditions and directs logs to distinct paths based on whether each log meets the conditions. For example, logs indicative of errors such as failed transactions in a payment service should be sent to a path for alerting and immediate attention. On the other hand, logs related to inventory updates might be sent to a separate path for data warehousing and trend analysis. While logs related to user validation errors might need to be routed elsewhere for security.
Conceptually, a Route node with only one path and no links to its unmatched path functions as a Regex Filter node. The benefit of a Route node is the ability to process multiple matching criteria for distinct node outputs, as well as the ability to handle unmatched logs for further processing on another output path. A Route node can evaluate logs based on CEL macros, not just regex, and it can evaluate all logs fields while a Regex Filter only evaluates the log body field.
Prerequisites
To route logs in a pipeline you need an Edge Delta account with a Pipeline configuration already created. This is the configuration in which you will create the Route node.
Create the Route Node
- In the Edge Delta App, click Pipelines.
- Select the fleet you want to edit and click View/Edit Pipeline.
- Click Edit Mode.
- Click Add Processor, expand Filters and select Route.
- Specify a Name for the Route node
route_test
. - Click Add New in the Paths section.
- Enter a suitable name for the first path such as
PaymentService_Path
in the Path field. - Specify a suitable CEL macro in the Condition field, such as the following one which identifies logs containing the word
PaymentService
:
regex_match(item["body"], "PaymentService")
- Click Add New in the Paths section.
- Enter a suitable name for the second path such as
AuthService_Path
in the Path field. - Specify a suitable CEL macro in the Condition field, such as the following one which identifies logs containing the word
AuthService
:
regex_match(item["body"], "AuthService")
- Click Save Changes.
- Connect the data source that emits both services’ logs to the input of the Route node.
- Connect the first output on the Route node, such as PaymentService_Path to the appropriate downstream node for processing of PaymentService logs.
- Connect the second output on the Route node, such as AuthService_Path to the appropriate downstream node for processing of AuthService logs.
- Click Review Changes.
- Click Save Changes.
Logs containing PaymentService
will now be routed along the first pipeline path, those containing AuthService
will be routed along the second path, while all others will be passed to the unmatched path and dropped.