Processing steps

Add and configure the processing steps of a flow to classify, parse, and filter data, and reuse them as custom steps.

Flows can include a list of processing steps to select and transform the messages. The AxoRouters of the flow send all the log messages they receive through the processing steps. Then they forward the filtered and processed messages to the destination of the flow.

CAUTION:

AxoRouter runs the processing steps in the order they appear in the flow. Make sure to put the steps in the correct order.

To add processing steps to an existing flow, complete the following steps.

  1. Open the Flows page and select the flow you want to modify. Alternatively, select ⌘/Ctrl + K and enter the name of the flow.

  2. Select Process > Add New Processing Step.

  3. Select the type of the processing step to add.

    Process step types

    The following types of processing steps are available:

    • Classify : Automatically classify the data and assign vendor, product, and service labels. This step (or its equivalent in the Connector rule ) is required for the Parse and Reduce step to work.
    • FilterX : Execute an arbitrary FilterX snippet.
    • Fix Timestamp : Correct timestamps that have a wrong or missing timezone, or replace them with the time AxoRouter received the message.
    • Normalize : Normalize the data according to the specified standard: Azure Monitor, Cortex Data Model (XDM), CrowdStrike Parsing Standard (CrowdStrike), Dynatrace, Elastic Common Schema (ECS), or Open Cybersecurity Schema Framework (OCSF).
    • Parse : Automatically parse the data to extract structured information from the content of the message. The Classify step (or its equivalent in the Connector rule ) is required for the Parse step to work.
    • Probe : A measurement point that provides metrics about the throughput of the flow.
    • Reduce : Automatically remove redundant content from the messages. The Classify and Parse steps (or their equivalent in the Connector rule ) are required for the Reduce step to work.
    • Regex : Execute a regular expression on the message.
    • Select Messages : Filter the messages using a query. Only the matching messages go to the next steps.
    • Set Fields : Set the value of one or more fields on the message object.
    • Unset Field : Unset the specified field of the message object.

    To add a custom step that you’ve created earlier, select the Custom tab, then select the custom step.

  4. Configure the processing step as needed for your environment.

  5. (Optional) To apply the processing step only to specific messages from the flow, add a condition to the step: select more_vert > Add Condition on the step, enter the condition, then select Save. The condition appears in the header of the step. Conditions act as filters, but apply only to this step. The step doesn’t change the messages that don’t match the condition. These messages go to the next step. For details about the message schema and the available fields, see Message schema reference.

    Conditions use AQL queries. You can make complex filters with the Equals, Contains (partial match), and Match (regular expression match) operators. Note that:

    • AxoConsole autocompletes the built-in and custom labels and field names, as well as their most frequent values, but doesn’t autocomplete labels and variables created by data parsing and processing steps. See the Message schema for details.
    • You can use the AND and OR operators to combine expressions, and also parentheses if needed.
  6. (Optional) To describe the purpose of the step, select more_vert > Add Description on the step, enter the description, then select Save.

  7. (Optional) To change the location of the step in the flow, drag the step to a new location.

    The more_vert menu of the step also has the following actions:

    • Duplicate: Insert a copy of the step after the step.
    • Add Step Before and Add Step After: Insert a new processing step before or after the step.
    • Delete: Remove the step from the flow.

    To temporarily turn off a step without removing it, use the toggle in the header of the step.

  8. Select Save.

Classify

Automatically classify the data and assign vendor, product, and service labels. This step (or its equivalent in the Connector rule ) is a prerequisite for the Parse and Reduce step, and must be executed before them. AxoRouter can parse data from the supported data sources . If your source isn’t listed, contact us .

Classify messages and assign vendor, product, and service labels

FilterX

Execute an arbitrary FilterX snippet. The following example sets the meta.openobserve variable to a JSON object. The stream key of the object gets the value of the meta.host.labels.team field. The step uses a condition, so it runs only on messages where the meta.host.labels.team field isn’t empty.

  • Condition (set in the Add Condition dialog of the step): meta.host.labels.team != ''

  • Statements:

    Terminal window
    meta.openobserve = {"stream": meta.host.labels.team};

Apply FilterX transformations on the message

Fix timestamp

Correct the timestamp of messages that have a wrong or missing timezone. For example, many devices send their local time without a timezone, so AxoRouter interprets the timestamp in the wrong timezone, and the message appears hours earlier or later than it happened.

Prerequisite: The Fix Timestamp step requires AxoRouter version 0.78.0 or newer.

Set the following options:

  • Mode: How to correct the timestamp.

    • Closest timezone (default): Use the timezone that brings the timestamp closest to the time AxoRouter received the message. The step keeps the date and time of the timestamp, and changes only its timezone. If no timezone fits, the timestamp stays unchanged. The step doesn’t change rehydrated messages in this mode, because their reception time is the time of the rehydration.
    • Specific timezone: Use the timezone of the Timezone source below. The step keeps the date and time of the timestamp, and changes only its timezone.
    • Reception time: Replace the timestamp with the time AxoRouter received the message. Use this mode if the timestamp of the message is unreliable. This mode also sets the timestamp of messages that don’t have one.
  • Timezone source (only for the Specific timezone mode): Select one or more sources. AxoRouter tries them from top to bottom, and uses the first one that provides a timezone. If none of them does, the timestamp stays unchanged.

    • Custom FilterX expression: A FilterX expression that returns the name of a timezone, for example, meta.host.labels.tz.
    • Appliance tz label: The value of the tz label of the source host (appliance) that sent the message, for example, Europe/Budapest. For details on adding labels to hosts, see Custom labels and metadata. This source requires the Classify step (or its equivalent in the Connector rule ) before the Fix Timestamp step.
    • AxoRouter tz label: The value of the tz label of the AxoRouter that processes the message. AxoRouters without a tz label skip this source.
    • Fixed timezone: A timezone name, for example, Europe/Budapest. Numeric offsets like +02:00 don’t work. To set a fixed offset, use the Etc/GMT timezone names, but note that their sign is inverted: for UTC+2, use Etc/GMT-2. Use this source last, as a fallback for the other sources.
  • Timestamp field: The field that contains the timestamp to correct. Default value: log.time_unix_nano. For details on the available fields, see Message schema reference.

  • Minimum skew and Maximum skew: Correct the timestamp only if it differs from the reception time by at least the minimum, and at most the maximum skew. Leave them empty for no limit. For example:

    • A Minimum skew of 15m skips differences that no timezone can explain, because the smallest timezone offset in use is a quarter of an hour.
    • A Maximum skew of 25h skips differences that are too large to be a timezone offset, because the largest timezone offset in use is 14 hours.

    The Minimum skew can’t be larger than the Maximum skew. In Reception time mode, the step always sets the timestamp of messages that don’t have one, regardless of the skew limits.

The following example sets the timezone of messages from the tz label of the source host. If the host has no such label, it uses the Europe/Budapest timezone. The step changes only timestamps that are 15 minutes to 25 hours off from the reception time.

  • Mode: Specific timezone
  • Timezone source: Appliance tz label, Fixed timezone (Europe/Budapest)
  • Minimum skew: 15m
  • Maximum skew: 25h

Fix the timezone of timestamps

Normalize

Prerequisite: It’s recommended to enable the Classify step (or its equivalent in the Connector rule ) when using the Normalize step. Normalization implicitly performs the Parse step as well.

The Normalize step reformats the content of the message to the selected normalization scheme. AxoRouter supports the following normalization schemas:

Normalize message content

Parse

Prerequisite: The Classify step (or its equivalent in the Connector rule ) is required for the Parse step to work.

The Parse step automatically parses the data from the content of the message, and replaces the message content (the log.body field in the internal message schema) with the structured information. AxoRouter can parse data from the supported data sources . If your source isn’t listed, contact us . Alternatively, you can create your own parser using FilterX processing steps.

For example, if the message content is in the Common Event Format (CEF) , AxoRouter creates a structured FilterX dictionary from its content, like this:

CEF:0|KasperskyLab|SecurityCenter|13.2.0.1511|KLPRCI_TaskState|Completed successfully|1|foo=foo bar=bar baz=test

Parsed and structured content:

{
"version":"0",
"device_vendor":"KasperskyLab",
"device_product":"SecurityCenter",
"device_version":"13.2.0.1511",
"device_event_class_id":"KLPRCI_TaskState",
"name":"Completed successfully",
"agent_severity":"1",
"foo":"foo",
"bar":"bar",
"baz":"test"
}

Parse message content into structured data

By default, AxoRouter forwards the messages that it can’t parse to the next processing step of the flow. If you want to discard such messages instead, enable the Drop unparseable messages option.

Probe

Set a measurement point that provides metrics about the throughput of the flow. Note that:

  • You can’t name your probes input and output, as these are reserved.
  • Probe names can contain only lowercase alphanumeric characters, -, and ., and must start and end with an alphanumeric character.
  • If you add a probe called filtered to the flow, AxoRouter uses this point as the input metric data point to calculate the data reduction of the flow in the Dashboard page.

Add metrics checkpoints to the flow

For details, see Flow metrics.

Reduce

Prerequisite: The Classify and Parse steps (or their equivalent in the Connector rule ) are required for the Reduce step to work.

The Reduce step automatically removes redundant content from the messages.

  • If you want to keep certain fields unchanged, use the Keep fields field. For details on the message fields, see Message schema.
  • To see what changed in a message, add a Probe processing step before and after the reduce step, then use Flow tapping .

For details on how data reduction works, see Classify and reduce security data.

Remove unneeded data from the messages

Regex

Use a regular expression to process the message.

  • Input is an AxoSyslog template string, for example, ${MESSAGE}. AxoRouter matches the regular expression with this string.

  • Pattern is a Perl Compatible Regular Expression (PCRE). If you want to match the pattern to the whole string, use the ^ and $ anchors at the beginning and end of the pattern.

    You can use https://regex101.com/ with the ECMAScript flavor to validate your regex patterns. (For named capture groups, use the (?<group_name>pattern) syntax. The (?P<group_name>pattern) syntax doesn’t work.)

Named or anonymous capture groups show the parts of the pattern that AxoRouter extracts to the Field field. Specify a named capture group like (?<group_name>pattern). Its value is available as field_name["group_name"]. AxoRouter numbers the anonymous capture groups. For example, the value of the second group from (first.*) (bar|BAR) is available as field_name["2"]. When specifying variables, note the following points:

  • If you want to include the results in the outgoing message or in its metadata for other processing steps, you must:

    • Reference an existing variable or field. AxoRouter updates this field with the matches.
    • For new variables, use names for the variables that start with the $ character, or
    • declare them explicitly. For details, see the FilterX data model in the AxoSyslog documentation.
  • If the pattern doesn’t match, AxoRouter sets the field to an empty dictionary ({}). For details about the message schema and the available fields, see Message schema reference.

Regex example: Parse the raw message

The following processing step parses an unclassified log message from a firewall into a structured format in the log.body field:

  • Input: ${RAWMSG}

  • Pattern:

    ^(?<priority><\d+>)(?<version>\d+)\s(?<timestamp>[\d\-T:.Z]+)\s(?<hostname>[\w\-.]+)\s(?<appname>[\w\-]+)\s(?<event_id>\d+|\-)\s(?<msgid>\-)\s(?<unused>\-)\s(?<rule_id>[\w\d]+)\s(?<network>\w+)\s(?<action>\w+)\s(?<result>\w+)\s(?<rule_seq>\d+)\s(?<direction>\w+)\s(?<length>\d+)\s(?<protocol>\w+)\s(?<src_ip>\d+\.\d+\.\d+\.\d+)\/(?<src_port>\d+)->(?<dest_ip>\d+\.\d+\.\d+\.\d+)\/(?<dest_port>\d+)\s(?<tcp_flags>\w+)\s(?<policy>[\w\-.]+)
  • Field: log.body

Regex processing step

Regex example: Parse an existing field

The following processing step processes the entire log.body field for messages generated by the AxoSyslog loggen command and stores it in the log.pad field, for example:

2024-05-02T10:56:31.000000+00:00 localhost prg00000[1234]: seq: 0000000065, thread: 0000, runid: 1714647391, stamp: 2024-05-02T10:56:31 PADDPADDPADDPADD
  • Input: log.body

  • Pattern:

    seq:\s+(?<seq>\d+),\s+thread:\s+(?<thread>\d+),\s+runid:\s+(?<runid>\d+),\s+stamp:\s+(?<stamp>[^\s]+)
  • Field: log.pad

For details about the message schema and the available fields, see Message schema reference.

Select messages

Filter the messages using a query. Only the matching messages go to the next steps.

The following example selects messages that have the meta.service.name label set to nginx.

  • Query: meta.service.name = nginx

Filter messages in a flow

You can also select messages using various other metadata about the connection and the host that sent the data, the connector that received the data, the classification results, and also custom labels, for example:

  • a specific connector: meta.connector.name = axorouter-mysyslog-connector
  • a type of connector: meta.connector.type = otlp
  • a sender IP address: meta.connection.src_ip = 192.168.1.1
  • a specific product, if classification is enabled in an earlier processing step or in the connector that received the message: meta.product = fortigate (see Vendors for the metadata of a particular product)
  • a custom label you’ve added to the host: meta.host.labels.location = eu-west-1

In addition to exact matches, you can use the following operators:

  • != not equal (string match)
  • =* contains (substring match)
  • !*: doesn’t contain
  • =~: matches regular expression
  • !~: doesn’t match regular expression
  • ==~: matches case sensitive regular expression
  • !=~: doesn’t match case sensitive regular expression

You can combine multiple expressions using the AND (+) operator. (To delete an expression, press SHIFT+Backspace.)

For details about the message schema and the available fields, see Message schema reference.

Set fields

Set specific field of the message. You can use static values, and also dynamic values that were extracted from the message automatically by Axoflow or manually in a previous processing step. If the field doesn’t exist, it’s automatically created.

The type of the field can be boolean, string, number, and expression. Select expression to set the value of the field using a FilterX expression .

If you start to type the name of the field, AxoConsole shows matching and similar field names based on the message schema :

Field name autocomplete

To set more fields in the same step, select Add Field. To temporarily skip a field without removing it, use the toggle next to the field.

The following example sets the resource.attributes.format field to parsed.

  • Field: resource.attributes.format
  • Value: string, parsed

Set message field

Set the Splunk source field

The following example sets the Splunk source field to the name of the AxoRouter host. Add a condition to the step (more_vert > Add Condition) to match only the hosts where you want to set the source field. If you don’t set a condition, the step sets the source field of every message.

  • Condition (set in the Add Condition dialog of the step): meta.host.name = app-server-nginx
  • Field: meta.destination.splunk.source
  • Value: expression, meta.router.name

Set Splunk source field

Set destination options

Destination options are destination-specific fields that override the parameters of the destination for a flow or for specific messages, for example, the index for a Splunk destination, or the stream name for an OpenObserve destination. To change the parameters of the destination for every flow, edit the destination instead.

  1. In the Destination section of the flow, select Set Destination Options. The Set Destination Options dialog lists the fields that the destination supports.

    Select the destination-specific fields to set

  2. Clear the fields that you don’t need, then select Set Destination Options. AxoConsole inserts a Set Fields processing step into the flow with the selected fields.

    Set destination-specific fields

  3. Set the values of the fields.

You can insert this processing step multiple times if you want to set the fields to different values using conditions.

When using Set Destination Options, note that if you leave a parameter empty, AxoRouter sends it as an empty field to the destination. If you don’t want to send that field at all, delete the field.

Unset field

Unset a specific field of the message.

Unset message field

Custom steps

A custom step is a named, reusable sequence of processing steps. Create it once, then add it to multiple flows, connector rules , or other custom steps like any built-in processing step. For example, you can build a parsing and data reduction pipeline for a specific data source once, and reuse it everywhere you process that data.

A custom step is a reference: when you modify a custom step, the change applies to every flow, connector rule, and custom step that uses it.

To manage your custom steps, open Flows > Custom Steps. For each custom step, the list shows how many processing steps it contains, and where it’s used. Select the usage links to see the flows, connector rules, and other custom steps that include the custom step.

Custom processing steps

Create a custom step

  1. Open Flows > Custom Steps, then select Add Custom Step > Add Custom Step.

    Create custom processing steps

  2. Set the Name of the custom step. This name appears in the processing step list when you add the custom step to a flow. Note that:

    • The name can contain only lowercase alphanumeric characters, -, and ., and must start and end with an alphanumeric character.
    • You can’t change the name later.
  3. (Optional) Enter a Description for the custom step.

  4. Add the processing steps of the custom step. A custom step can contain other custom steps, but it can’t contain Probe steps.

    Configure custom processing steps

  5. Select Create Custom Step.

You can also create a custom step from the processing steps you’ve already configured:

  • Save existing steps: When editing the processing steps of a flow, , a rehydration, or a connector rule, select Save as Custom Step. AxoConsole creates a new custom step that contains the current processing steps. Set a name for the custom step, then select Create Custom Step.
  • Import from a file: Select Add Custom Step > Import JSON File, and upload a custom step that you’ve exported earlier.
  • Clone: In the list of custom steps, open the menu of a custom step and select Clone.

Modify a custom step

  1. Open Flows > Custom Steps, then select the custom step.

  2. Modify the custom step:

    CAUTION:

    Changes to a custom step affect every flow, connector rule, and custom step that uses it. Before modifying a custom step, check where it’s used.

    • To change the processing steps, select Process, edit the steps, then select Save.
    • To change the description, select Edit, modify the description, then select Save.

    Alternatively, when a flow includes a custom step, select more_vert > Navigate to custom step on the custom step in the flow to open the custom step in a new tab.

Nested custom steps

A custom step can include other custom steps. However, you can’t create reference loops:

  • A custom step can’t include itself.
  • A custom step can’t include another custom step that includes the first custom step, either directly or through other custom steps. For example, if step-a includes step-b, then step-b can’t include step-a.

AxoConsole rejects changes that would create a loop, and also rejects references to custom steps that don’t exist.

Export custom steps

To export a custom step into a JSON file, open Flows > Custom Steps, open the menu of the custom step, then select Export As JSON File. You can import the file into another Axoflow deployment.

Delete custom steps

To delete a custom step, open Flows > Custom Steps, open the menu of the custom step, then select Delete. You can’t delete a custom step that’s used by a flow, a connector rule, or another custom step. Remove the custom step from these resources first.